trackler 2.2.1.53 → 2.2.1.54
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/trackler/version.rb +1 -1
- data/problem-specifications/exercises/nth-prime/canonical-data.json +2 -7
- data/problem-specifications/exercises/zebra-puzzle/canonical-data.json +16 -0
- data/tracks/c/config.json +11 -1
- data/tracks/c/docs/C_STYLE_GUIDE.md +142 -0
- data/tracks/c/exercises/collatz-conjecture/README.md +65 -0
- data/tracks/c/exercises/collatz-conjecture/makefile +15 -0
- data/tracks/c/exercises/collatz-conjecture/src/collatz_conjecture.h +8 -0
- data/tracks/c/exercises/collatz-conjecture/src/example.c +23 -0
- data/tracks/c/exercises/collatz-conjecture/test/test_collatz_conjecture.c +48 -0
- data/tracks/c/exercises/collatz-conjecture/test/vendor/unity.c +1300 -0
- data/tracks/c/exercises/collatz-conjecture/test/vendor/unity.h +274 -0
- data/tracks/c/exercises/collatz-conjecture/test/vendor/unity_internals.h +701 -0
- data/tracks/cfml/tasks/GenerateReadme.cfc +5 -5
- data/tracks/erlang/testgen/src/testgen.erl +99 -17
- data/tracks/erlang/testgen/src/tg_file_tools.erl +3 -3
- data/tracks/erlang/testgen/src/tgen.erl +15 -7
- data/tracks/haskell/config.json +15 -3
- data/tracks/java/scripts/canonical_data_check.sh +1 -1
- data/tracks/javascript/config.json +12 -0
- data/tracks/javascript/exercises/difference-of-squares/README.md +1 -1
- data/tracks/javascript/exercises/sum-of-multiples/README.md +1 -1
- data/tracks/javascript/exercises/zipper/README.md +55 -0
- data/tracks/javascript/exercises/zipper/example.js +100 -0
- data/tracks/javascript/exercises/zipper/zipper.spec.js +77 -0
- data/tracks/julia/config.json +12 -0
- data/tracks/julia/exercises/triangle/README.md +30 -0
- data/tracks/julia/exercises/triangle/example.jl +25 -0
- data/tracks/julia/exercises/triangle/runtests.jl +64 -0
- data/tracks/julia/exercises/triangle/triangle.jl +8 -0
- data/tracks/kotlin/exercises/leap/.meta/version +1 -1
- data/tracks/kotlin/exercises/leap/src/test/kotlin/LeapTest.kt +1 -1
- data/tracks/kotlin/scripts/canonical_data_check.sh +1 -1
- data/tracks/perl6/bin/README.md +1 -4
- data/tracks/perl6/bin/exercise-gen.pl6 +3 -4
- data/tracks/perl6/exercises/accumulate/example.yaml +2 -2
- data/tracks/perl6/exercises/all-your-base/example.yaml +9 -9
- data/tracks/perl6/exercises/allergies/example.yaml +7 -7
- data/tracks/perl6/exercises/anagram/example.yaml +3 -3
- data/tracks/perl6/exercises/atbash-cipher/example.yaml +3 -3
- data/tracks/perl6/exercises/bob/example.yaml +4 -4
- data/tracks/perl6/exercises/clock/example.yaml +6 -6
- data/tracks/perl6/exercises/flatten-array/example.yaml +4 -4
- data/tracks/perl6/exercises/grade-school/example.yaml +6 -6
- data/tracks/perl6/exercises/grains/example.yaml +3 -3
- data/tracks/perl6/exercises/hello-world/example.yaml +5 -5
- data/tracks/perl6/exercises/leap/example.yaml +4 -4
- data/tracks/perl6/exercises/linked-list/example.yaml +14 -14
- data/tracks/perl6/exercises/luhn/example.yaml +3 -3
- data/tracks/perl6/exercises/phone-number/example.yaml +3 -3
- data/tracks/perl6/exercises/raindrops/example.yaml +3 -3
- data/tracks/perl6/exercises/rna-transcription/example.yaml +3 -3
- data/tracks/perl6/exercises/robot-name/example.yaml +8 -8
- data/tracks/perl6/exercises/scrabble-score/example.yaml +3 -3
- data/tracks/perl6/exercises/space-age/example.yaml +8 -8
- data/tracks/perl6/exercises/word-count/example.yaml +3 -3
- data/tracks/perl6/exercises/wordy/example.yaml +3 -3
- data/tracks/python/config.json +14 -0
- data/tracks/python/config/maintainers.json +30 -0
- data/tracks/python/docs/EXERCISE_README_INSERT.md +1 -2
- data/tracks/python/exercises/accumulate/README.md +1 -5
- data/tracks/python/exercises/acronym/README.md +1 -3
- data/tracks/python/exercises/all-your-base/README.md +2 -3
- data/tracks/python/exercises/all-your-base/all_your_base_test.py +13 -13
- data/tracks/python/exercises/allergies/README.md +1 -3
- data/tracks/python/exercises/alphametics/README.md +3 -4
- data/tracks/python/exercises/anagram/README.md +1 -2
- data/tracks/python/exercises/atbash-cipher/README.md +3 -3
- data/tracks/python/exercises/beer-song/README.md +2 -3
- data/tracks/python/exercises/binary-search/README.md +1 -2
- data/tracks/python/exercises/binary/README.md +3 -2
- data/tracks/python/exercises/bob/README.md +1 -2
- data/tracks/python/exercises/book-store/README.md +6 -7
- data/tracks/python/exercises/bracket-push/README.md +1 -2
- data/tracks/python/exercises/change/README.md +2 -3
- data/tracks/python/exercises/circular-buffer/README.md +14 -8
- data/tracks/python/exercises/clock/README.md +1 -2
- data/tracks/python/exercises/clock/clock_test.py +2 -0
- data/tracks/python/exercises/collatz-conjecture/.meta/hints.md +3 -0
- data/tracks/python/exercises/collatz-conjecture/README.md +6 -19
- data/tracks/python/exercises/complex-numbers/README.md +28 -2
- data/tracks/python/exercises/crypto-square/README.md +11 -10
- data/tracks/python/exercises/diamond/README.md +7 -8
- data/tracks/python/exercises/difference-of-squares/README.md +1 -2
- data/tracks/python/exercises/diffie-hellman/.meta/hints.md +1 -1
- data/tracks/python/exercises/diffie-hellman/README.md +3 -2
- data/tracks/python/exercises/error-handling/.meta/hints.md +8 -0
- data/tracks/python/exercises/error-handling/README.md +10 -2
- data/tracks/python/exercises/error-handling/error_handling_test.py +15 -3
- data/tracks/python/exercises/etl/README.md +3 -2
- data/tracks/python/exercises/flatten-array/README.md +2 -4
- data/tracks/python/exercises/food-chain/README.md +3 -4
- data/tracks/python/exercises/forth/README.md +2 -6
- data/tracks/python/exercises/gigasecond/README.md +1 -2
- data/tracks/python/exercises/grade-school/README.md +1 -3
- data/tracks/python/exercises/grains/README.md +1 -3
- data/tracks/python/exercises/grep/README.md +13 -14
- data/tracks/python/exercises/hamming/README.md +1 -2
- data/tracks/python/exercises/hamming/hamming_test.py +6 -6
- data/tracks/python/exercises/hello-world/README.md +1 -2
- data/tracks/python/exercises/hexadecimal/README.md +1 -2
- data/tracks/python/exercises/hexadecimal/example.py +6 -6
- data/tracks/python/exercises/house/README.md +2 -4
- data/tracks/python/exercises/isogram/README.md +3 -3
- data/tracks/python/exercises/kindergarten-garden/README.md +14 -15
- data/tracks/python/exercises/largest-series-product/README.md +1 -2
- data/tracks/python/exercises/leap/README.md +2 -3
- data/tracks/python/exercises/linked-list/README.md +11 -12
- data/tracks/python/exercises/list-ops/README.md +1 -2
- data/tracks/python/exercises/luhn/README.md +8 -9
- data/tracks/python/exercises/markdown/README.md +1 -6
- data/tracks/python/exercises/matrix/README.md +7 -6
- data/tracks/python/exercises/meetup/README.md +2 -4
- data/tracks/python/exercises/minesweeper/README.md +1 -2
- data/tracks/python/exercises/nth-prime/README.md +1 -2
- data/tracks/python/exercises/nucleotide-count/README.md +9 -24
- data/tracks/python/exercises/ocr-numbers/README.md +6 -7
- data/tracks/python/exercises/octal/README.md +7 -4
- data/tracks/python/exercises/palindrome-products/README.md +16 -18
- data/tracks/python/exercises/pangram/README.md +2 -3
- data/tracks/python/exercises/pascals-triangle/README.md +2 -3
- data/tracks/python/exercises/perfect-numbers/README.md +3 -4
- data/tracks/python/exercises/phone-number/README.md +4 -4
- data/tracks/python/exercises/pig-latin/README.md +1 -2
- data/tracks/python/exercises/point-mutations/README.md +1 -2
- data/tracks/python/exercises/poker/README.md +1 -2
- data/tracks/python/exercises/prime-factors/README.md +1 -2
- data/tracks/python/exercises/protein-translation/README.md +5 -7
- data/tracks/python/exercises/proverb/README.md +12 -11
- data/tracks/python/exercises/pythagorean-triplet/README.md +4 -5
- data/tracks/python/exercises/queen-attack/README.md +2 -3
- data/tracks/python/exercises/rail-fence-cipher/README.md +13 -9
- data/tracks/python/exercises/raindrops/README.md +1 -2
- data/tracks/python/exercises/rectangles/README.md +8 -9
- data/tracks/python/exercises/rectangles/example.py +3 -3
- data/tracks/python/exercises/rna-transcription/README.md +1 -2
- data/tracks/python/exercises/rna-transcription/rna_transcription_test.py +4 -3
- data/tracks/python/exercises/robot-name/README.md +1 -2
- data/tracks/python/exercises/robot-simulator/README.md +1 -2
- data/tracks/python/exercises/roman-numerals/README.md +2 -3
- data/tracks/python/exercises/rotational-cipher/README.md +3 -3
- data/tracks/python/exercises/run-length-encoding/README.md +5 -6
- data/tracks/python/exercises/run-length-encoding/example.py +2 -2
- data/tracks/python/exercises/saddle-points/README.md +2 -3
- data/tracks/python/exercises/say/README.md +1 -2
- data/tracks/python/exercises/scale-generator/README.md +1 -3
- data/tracks/python/exercises/scrabble-score/README.md +4 -3
- data/tracks/python/exercises/secret-handshake/README.md +2 -3
- data/tracks/python/exercises/series/README.md +1 -2
- data/tracks/python/exercises/sieve/README.md +1 -2
- data/tracks/python/exercises/simple-cipher/README.md +3 -4
- data/tracks/python/exercises/space-age/README.md +2 -3
- data/tracks/python/exercises/space-age/space_age_test.py +18 -29
- data/tracks/python/exercises/strain/README.md +1 -2
- data/tracks/python/exercises/sublist/README.md +1 -2
- data/tracks/python/exercises/sum-of-multiples/README.md +1 -5
- data/tracks/python/exercises/tournament/README.md +6 -7
- data/tracks/python/exercises/transpose/README.md +8 -9
- data/tracks/python/exercises/tree-building/README.md +25 -0
- data/tracks/python/exercises/tree-building/example.py +46 -0
- data/tracks/python/exercises/tree-building/tree_building.py +50 -0
- data/tracks/python/exercises/tree-building/tree_building_test.py +183 -0
- data/tracks/python/exercises/triangle/README.md +10 -8
- data/tracks/python/exercises/trinary/README.md +2 -3
- data/tracks/python/exercises/twelve-days/README.md +2 -3
- data/tracks/python/exercises/two-bucket/README.md +4 -5
- data/tracks/python/exercises/two-bucket/two_bucket_test.py +2 -0
- data/tracks/python/exercises/two-fer/README.md +4 -5
- data/tracks/python/exercises/two-fer/two_fer_test.py +5 -2
- data/tracks/python/exercises/variable-length-quantity/README.md +7 -9
- data/tracks/python/exercises/word-count/README.md +2 -4
- data/tracks/python/exercises/word-search/README.md +2 -3
- data/tracks/python/exercises/wordy/README.md +1 -7
- data/tracks/python/exercises/wordy/example.py +8 -8
- data/tracks/python/exercises/wordy/wordy_test.py +36 -32
- data/tracks/python/exercises/zebra-puzzle/README.md +1 -2
- data/tracks/python/requirements-travis.txt +1 -1
- data/tracks/ruby/config.json +11 -0
- data/tracks/ruby/docs/TESTS.md +6 -0
- data/tracks/ruby/exercises/pangram/.meta/.version +1 -1
- data/tracks/ruby/exercises/pangram/.meta/solutions/pangram.rb +1 -1
- data/tracks/ruby/exercises/pangram/pangram_test.rb +11 -4
- data/tracks/ruby/exercises/two-fer/.meta/.version +1 -0
- data/tracks/ruby/exercises/two-fer/.meta/generator/two_fer_case.rb +12 -0
- data/tracks/ruby/exercises/two-fer/.meta/solutions/two_fer.rb +9 -0
- data/tracks/ruby/exercises/two-fer/README.md +69 -0
- data/tracks/ruby/exercises/two-fer/two_fer_test.rb +42 -0
- data/tracks/rust/config.json +12 -0
- data/tracks/rust/exercises/binary-search/.meta/hints.md +38 -0
- data/tracks/rust/exercises/binary-search/Cargo.lock +4 -0
- data/tracks/rust/exercises/binary-search/Cargo.toml +6 -0
- data/tracks/rust/exercises/binary-search/README.md +113 -0
- data/tracks/rust/exercises/binary-search/example.rs +29 -0
- data/tracks/rust/exercises/binary-search/src/lib.rs +0 -0
- data/tracks/rust/exercises/binary-search/tests/binary-search.rs +96 -0
- data/tracks/typescript/common/package.json +6 -6
- data/tracks/typescript/common/yarn.lock +929 -610
- data/tracks/typescript/exercises/acronym/package.json +6 -6
- data/tracks/typescript/exercises/acronym/yarn.lock +929 -610
- data/tracks/typescript/exercises/anagram/package.json +6 -6
- data/tracks/typescript/exercises/anagram/yarn.lock +929 -610
- data/tracks/typescript/exercises/beer-song/package.json +6 -6
- data/tracks/typescript/exercises/beer-song/yarn.lock +929 -610
- data/tracks/typescript/exercises/binary-search-tree/package.json +6 -6
- data/tracks/typescript/exercises/binary-search-tree/yarn.lock +929 -610
- data/tracks/typescript/exercises/binary-search/package.json +6 -6
- data/tracks/typescript/exercises/binary-search/yarn.lock +929 -610
- data/tracks/typescript/exercises/bob/package.json +6 -6
- data/tracks/typescript/exercises/bob/yarn.lock +929 -610
- data/tracks/typescript/exercises/circular-buffer/package.json +6 -6
- data/tracks/typescript/exercises/circular-buffer/yarn.lock +929 -610
- data/tracks/typescript/exercises/clock/package.json +6 -6
- data/tracks/typescript/exercises/clock/yarn.lock +929 -610
- data/tracks/typescript/exercises/difference-of-squares/package.json +6 -6
- data/tracks/typescript/exercises/difference-of-squares/yarn.lock +929 -610
- data/tracks/typescript/exercises/etl/package.json +6 -6
- data/tracks/typescript/exercises/etl/yarn.lock +929 -610
- data/tracks/typescript/exercises/food-chain/package.json +6 -6
- data/tracks/typescript/exercises/food-chain/yarn.lock +929 -610
- data/tracks/typescript/exercises/gigasecond/package.json +6 -6
- data/tracks/typescript/exercises/gigasecond/yarn.lock +929 -610
- data/tracks/typescript/exercises/grade-school/package.json +6 -6
- data/tracks/typescript/exercises/grade-school/yarn.lock +929 -610
- data/tracks/typescript/exercises/hamming/package.json +6 -6
- data/tracks/typescript/exercises/hamming/yarn.lock +929 -610
- data/tracks/typescript/exercises/hello-world/README.md +354 -0
- data/tracks/typescript/exercises/hello-world/package.json +6 -6
- data/tracks/typescript/exercises/hello-world/yarn.lock +929 -610
- data/tracks/typescript/exercises/largest-series-product/package.json +6 -6
- data/tracks/typescript/exercises/largest-series-product/yarn.lock +929 -610
- data/tracks/typescript/exercises/leap/package.json +6 -6
- data/tracks/typescript/exercises/leap/yarn.lock +929 -610
- data/tracks/typescript/exercises/linked-list/package.json +6 -6
- data/tracks/typescript/exercises/linked-list/yarn.lock +929 -610
- data/tracks/typescript/exercises/nth-prime/package.json +6 -6
- data/tracks/typescript/exercises/nth-prime/yarn.lock +929 -610
- data/tracks/typescript/exercises/pangram/package.json +6 -6
- data/tracks/typescript/exercises/pangram/yarn.lock +929 -610
- data/tracks/typescript/exercises/pascals-triangle/package.json +6 -6
- data/tracks/typescript/exercises/pascals-triangle/yarn.lock +929 -610
- data/tracks/typescript/exercises/phone-number/package.json +6 -6
- data/tracks/typescript/exercises/phone-number/yarn.lock +929 -610
- data/tracks/typescript/exercises/prime-factors/package.json +6 -6
- data/tracks/typescript/exercises/prime-factors/yarn.lock +929 -610
- data/tracks/typescript/exercises/raindrops/package.json +6 -6
- data/tracks/typescript/exercises/raindrops/yarn.lock +929 -610
- data/tracks/typescript/exercises/rna-transcription/package.json +6 -6
- data/tracks/typescript/exercises/rna-transcription/yarn.lock +929 -610
- data/tracks/typescript/exercises/robot-name/package.json +6 -6
- data/tracks/typescript/exercises/robot-name/yarn.lock +929 -610
- data/tracks/typescript/exercises/robot-simulator/package.json +6 -6
- data/tracks/typescript/exercises/robot-simulator/yarn.lock +929 -610
- data/tracks/typescript/exercises/rotational-cipher/package.json +6 -6
- data/tracks/typescript/exercises/rotational-cipher/yarn.lock +929 -610
- data/tracks/typescript/exercises/say/package.json +6 -6
- data/tracks/typescript/exercises/say/yarn.lock +929 -610
- data/tracks/typescript/exercises/scrabble-score/package.json +6 -6
- data/tracks/typescript/exercises/scrabble-score/yarn.lock +929 -610
- data/tracks/typescript/exercises/series/package.json +6 -6
- data/tracks/typescript/exercises/series/yarn.lock +929 -610
- data/tracks/typescript/exercises/space-age/package.json +6 -6
- data/tracks/typescript/exercises/space-age/yarn.lock +929 -610
- data/tracks/typescript/exercises/strain/package.json +6 -6
- data/tracks/typescript/exercises/strain/yarn.lock +929 -610
- data/tracks/typescript/exercises/sum-of-multiples/package.json +6 -6
- data/tracks/typescript/exercises/sum-of-multiples/yarn.lock +929 -610
- data/tracks/typescript/exercises/triangle/package.json +6 -6
- data/tracks/typescript/exercises/triangle/yarn.lock +929 -610
- data/tracks/typescript/exercises/word-count/package.json +6 -6
- data/tracks/typescript/exercises/word-count/yarn.lock +929 -610
- data/tracks/typescript/exercises/wordy/package.json +6 -6
- data/tracks/typescript/exercises/wordy/yarn.lock +929 -610
- metadata +37 -2
@@ -2,19 +2,18 @@
|
|
2
2
|
|
3
3
|
Determine if a sentence is a pangram. A pangram (Greek: παν γράμμα, pan gramma,
|
4
4
|
"every letter") is a sentence using every letter of the alphabet at least once.
|
5
|
-
The best known English pangram is:
|
5
|
+
The best known English pangram is:
|
6
6
|
> The quick brown fox jumps over the lazy dog.
|
7
7
|
|
8
8
|
The alphabet used consists of ASCII letters `a` to `z`, inclusive, and is case
|
9
9
|
insensitive. Input will not contain non-ASCII symbols.
|
10
10
|
|
11
|
-
|
11
|
+
## Submitting Exercises
|
12
12
|
|
13
13
|
Note that, when trying to submit an exercise, make sure the solution is in the `exercism/python/<exerciseName>` directory.
|
14
14
|
|
15
15
|
For example, if you're submitting `bob.py` for the Bob exercise, the submit command would be something like `exercism submit <path_to_exercism_dir>/python/bob/bob.py`.
|
16
16
|
|
17
|
-
|
18
17
|
For more detailed information about running tests, code style and linting,
|
19
18
|
please see the [help page](http://exercism.io/languages/python).
|
20
19
|
|
@@ -5,7 +5,7 @@ Compute Pascal's triangle up to a given number of rows.
|
|
5
5
|
In Pascal's Triangle each number is computed by adding the numbers to
|
6
6
|
the right and left of the current position in the previous row.
|
7
7
|
|
8
|
-
```
|
8
|
+
```text
|
9
9
|
1
|
10
10
|
1 1
|
11
11
|
1 2 1
|
@@ -14,13 +14,12 @@ the right and left of the current position in the previous row.
|
|
14
14
|
# ... etc
|
15
15
|
```
|
16
16
|
|
17
|
-
|
17
|
+
## Submitting Exercises
|
18
18
|
|
19
19
|
Note that, when trying to submit an exercise, make sure the solution is in the `exercism/python/<exerciseName>` directory.
|
20
20
|
|
21
21
|
For example, if you're submitting `bob.py` for the Bob exercise, the submit command would be something like `exercism submit <path_to_exercism_dir>/python/bob/bob.py`.
|
22
22
|
|
23
|
-
|
24
23
|
For more detailed information about running tests, code style and linting,
|
25
24
|
please see the [help page](http://exercism.io/languages/python).
|
26
25
|
|
@@ -5,7 +5,7 @@ Nicomachus' (60 - 120 CE) classification scheme for natural numbers.
|
|
5
5
|
|
6
6
|
The Greek mathematician [Nicomachus](https://en.wikipedia.org/wiki/Nicomachus) devised a classification scheme for natural numbers, identifying each as belonging uniquely to the categories of **perfect**, **abundant**, or **deficient** based on their [aliquot sum](https://en.wikipedia.org/wiki/Aliquot_sum). The aliquot sum is defined as the sum of the factors of a number not including the number itself. For example, the aliquot sum of 15 is (1 + 3 + 5) = 9
|
7
7
|
|
8
|
-
- **Perfect**: aliquot sum = number
|
8
|
+
- **Perfect**: aliquot sum = number
|
9
9
|
- 6 is a perfect number because (1 + 2 + 3) = 6
|
10
10
|
- 28 is a perfect number because (1 + 2 + 4 + 7 + 14) = 28
|
11
11
|
- **Abundant**: aliquot sum > number
|
@@ -14,16 +14,15 @@ The Greek mathematician [Nicomachus](https://en.wikipedia.org/wiki/Nicomachus) d
|
|
14
14
|
- **Deficient**: aliquot sum < number
|
15
15
|
- 8 is a deficient number because (1 + 2 + 4) = 7
|
16
16
|
- Prime numbers are deficient
|
17
|
-
|
17
|
+
|
18
18
|
Implement a way to determine whether a given number is **perfect**. Depending on your language track, you may also need to implement a way to determine whether a given number is **abundant** or **deficient**.
|
19
19
|
|
20
|
-
|
20
|
+
## Submitting Exercises
|
21
21
|
|
22
22
|
Note that, when trying to submit an exercise, make sure the solution is in the `exercism/python/<exerciseName>` directory.
|
23
23
|
|
24
24
|
For example, if you're submitting `bob.py` for the Bob exercise, the submit command would be something like `exercism submit <path_to_exercism_dir>/python/bob/bob.py`.
|
25
25
|
|
26
|
-
|
27
26
|
For more detailed information about running tests, code style and linting,
|
28
27
|
please see the [help page](http://exercism.io/languages/python).
|
29
28
|
|
@@ -6,11 +6,12 @@ The **North American Numbering Plan (NANP)** is a telephone numbering system use
|
|
6
6
|
|
7
7
|
NANP numbers are ten-digit numbers consisting of a three-digit Numbering Plan Area code, commonly known as *area code*, followed by a seven-digit local number. The first three digits of the local number represent the *exchange code*, followed by the unique four-digit number which is the *subscriber number*.
|
8
8
|
|
9
|
-
|
10
9
|
The format is usually represented as
|
11
|
-
|
10
|
+
|
11
|
+
```text
|
12
12
|
(NXX)-NXX-XXXX
|
13
13
|
```
|
14
|
+
|
14
15
|
where `N` is any digit from 2 through 9 and `X` is any digit from 0 through 9.
|
15
16
|
|
16
17
|
Your task is to clean up differently formated telephone numbers by removing punctuation and the country code (1) if present.
|
@@ -27,13 +28,12 @@ should all produce the output
|
|
27
28
|
|
28
29
|
**Note:** As this exercise only deals with telephone numbers used in NANP-countries, only 1 is considered a valid country code.
|
29
30
|
|
30
|
-
|
31
|
+
## Submitting Exercises
|
31
32
|
|
32
33
|
Note that, when trying to submit an exercise, make sure the solution is in the `exercism/python/<exerciseName>` directory.
|
33
34
|
|
34
35
|
For example, if you're submitting `bob.py` for the Bob exercise, the submit command would be something like `exercism submit <path_to_exercism_dir>/python/bob/bob.py`.
|
35
36
|
|
36
|
-
|
37
37
|
For more detailed information about running tests, code style and linting,
|
38
38
|
please see the [help page](http://exercism.io/languages/python).
|
39
39
|
|
@@ -17,13 +17,12 @@ variants too.
|
|
17
17
|
|
18
18
|
See <http://en.wikipedia.org/wiki/Pig_latin> for more details.
|
19
19
|
|
20
|
-
|
20
|
+
## Submitting Exercises
|
21
21
|
|
22
22
|
Note that, when trying to submit an exercise, make sure the solution is in the `exercism/python/<exerciseName>` directory.
|
23
23
|
|
24
24
|
For example, if you're submitting `bob.py` for the Bob exercise, the submit command would be something like `exercism submit <path_to_exercism_dir>/python/bob/bob.py`.
|
25
25
|
|
26
|
-
|
27
26
|
For more detailed information about running tests, code style and linting,
|
28
27
|
please see the [help page](http://exercism.io/languages/python).
|
29
28
|
|
@@ -34,13 +34,12 @@ distance function.
|
|
34
34
|
|
35
35
|
**Note: This problem is deprecated, replaced by the one called `hamming`.**
|
36
36
|
|
37
|
-
|
37
|
+
## Submitting Exercises
|
38
38
|
|
39
39
|
Note that, when trying to submit an exercise, make sure the solution is in the `exercism/python/<exerciseName>` directory.
|
40
40
|
|
41
41
|
For example, if you're submitting `bob.py` for the Bob exercise, the submit command would be something like `exercism submit <path_to_exercism_dir>/python/bob/bob.py`.
|
42
42
|
|
43
|
-
|
44
43
|
For more detailed information about running tests, code style and linting,
|
45
44
|
please see the [help page](http://exercism.io/languages/python).
|
46
45
|
|
@@ -5,13 +5,12 @@ Pick the best hand(s) from a list of poker hands.
|
|
5
5
|
See [wikipedia](https://en.wikipedia.org/wiki/List_of_poker_hands) for an
|
6
6
|
overview of poker hands.
|
7
7
|
|
8
|
-
|
8
|
+
## Submitting Exercises
|
9
9
|
|
10
10
|
Note that, when trying to submit an exercise, make sure the solution is in the `exercism/python/<exerciseName>` directory.
|
11
11
|
|
12
12
|
For example, if you're submitting `bob.py` for the Bob exercise, the submit command would be something like `exercism submit <path_to_exercism_dir>/python/bob/bob.py`.
|
13
13
|
|
14
|
-
|
15
14
|
For more detailed information about running tests, code style and linting,
|
16
15
|
please see the [help page](http://exercism.io/languages/python).
|
17
16
|
|
@@ -29,13 +29,12 @@ You can check this yourself:
|
|
29
29
|
- = 60
|
30
30
|
- Success!
|
31
31
|
|
32
|
-
|
32
|
+
## Submitting Exercises
|
33
33
|
|
34
34
|
Note that, when trying to submit an exercise, make sure the solution is in the `exercism/python/<exerciseName>` directory.
|
35
35
|
|
36
36
|
For example, if you're submitting `bob.py` for the Bob exercise, the submit command would be something like `exercism submit <path_to_exercism_dir>/python/bob/bob.py`.
|
37
37
|
|
38
|
-
|
39
38
|
For more detailed information about running tests, code style and linting,
|
40
39
|
please see the [help page](http://exercism.io/languages/python).
|
41
40
|
|
@@ -10,17 +10,17 @@ Codons: `"AUG", "UUU", "UCU"`
|
|
10
10
|
=> which become a polypeptide with the following sequence =>
|
11
11
|
|
12
12
|
Protein: `"Methionine", "Phenylalanine", "Serine"`
|
13
|
-
|
13
|
+
|
14
14
|
There are 64 codons which in turn correspond to 20 amino acids; however, all of the codon sequences and resulting amino acids are not important in this exercise. If it works for one codon, the program should work for all of them.
|
15
|
-
However, feel free to expand the list in the test suite to include them all.
|
15
|
+
However, feel free to expand the list in the test suite to include them all.
|
16
16
|
|
17
|
-
There are also
|
17
|
+
There are also three terminating codons (also known as 'STOP' codons); if any of these codons are encountered (by the ribosome), all translation ends and the protein is terminated.
|
18
18
|
|
19
19
|
All subsequent codons after are ignored, like this:
|
20
20
|
|
21
21
|
RNA: `"AUGUUUUCUUAAAUG"` =>
|
22
22
|
|
23
|
-
Codons: `"AUG", "UUU", "UCU", "UAG", "AUG"` =>
|
23
|
+
Codons: `"AUG", "UUU", "UCU", "UAG", "AUG"` =>
|
24
24
|
|
25
25
|
Protein: `"Methionine", "Phenylalanine", "Serine"`
|
26
26
|
|
@@ -39,16 +39,14 @@ UGU, UGC | Cysteine
|
|
39
39
|
UGG | Tryptophan
|
40
40
|
UAA, UAG, UGA | STOP
|
41
41
|
|
42
|
-
|
43
42
|
Learn more about [protein translation on Wikipedia](http://en.wikipedia.org/wiki/Translation_(biology))
|
44
43
|
|
45
|
-
|
44
|
+
## Submitting Exercises
|
46
45
|
|
47
46
|
Note that, when trying to submit an exercise, make sure the solution is in the `exercism/python/<exerciseName>` directory.
|
48
47
|
|
49
48
|
For example, if you're submitting `bob.py` for the Bob exercise, the submit command would be something like `exercism submit <path_to_exercism_dir>/python/bob/bob.py`.
|
50
49
|
|
51
|
-
|
52
50
|
For more detailed information about running tests, code style and linting,
|
53
51
|
please see the [help page](http://exercism.io/languages/python).
|
54
52
|
|
@@ -1,23 +1,24 @@
|
|
1
1
|
# Proverb
|
2
2
|
|
3
|
-
For want of a horseshoe nail, a kingdom was lost, or so the saying goes.
|
4
|
-
the full text of this proverbial rhyme:
|
3
|
+
For want of a horseshoe nail, a kingdom was lost, or so the saying goes.
|
5
4
|
|
6
|
-
|
7
|
-
> For want of a shoe the horse was lost.
|
8
|
-
> For want of a horse the rider was lost.
|
9
|
-
> For want of a rider the message was lost.
|
10
|
-
> For want of a message the battle was lost.
|
11
|
-
> For want of a battle the kingdom was lost.
|
12
|
-
> And all for the want of a horseshoe nail.
|
5
|
+
Output the full text of this proverbial rhyme:
|
13
6
|
|
14
|
-
|
7
|
+
```text
|
8
|
+
For want of a nail the shoe was lost.
|
9
|
+
For want of a shoe the horse was lost.
|
10
|
+
For want of a horse the rider was lost.
|
11
|
+
For want of a rider the message was lost.
|
12
|
+
For want of a message the battle was lost.
|
13
|
+
For want of a battle the kingdom was lost.
|
14
|
+
And all for the want of a horseshoe nail.
|
15
|
+
```
|
16
|
+
## Submitting Exercises
|
15
17
|
|
16
18
|
Note that, when trying to submit an exercise, make sure the solution is in the `exercism/python/<exerciseName>` directory.
|
17
19
|
|
18
20
|
For example, if you're submitting `bob.py` for the Bob exercise, the submit command would be something like `exercism submit <path_to_exercism_dir>/python/bob/bob.py`.
|
19
21
|
|
20
|
-
|
21
22
|
For more detailed information about running tests, code style and linting,
|
22
23
|
please see the [help page](http://exercism.io/languages/python).
|
23
24
|
|
@@ -3,13 +3,13 @@
|
|
3
3
|
A Pythagorean triplet is a set of three natural numbers, {a, b, c}, for
|
4
4
|
which,
|
5
5
|
|
6
|
-
```
|
6
|
+
```text
|
7
7
|
a**2 + b**2 = c**2
|
8
8
|
```
|
9
9
|
|
10
|
-
For example,
|
10
|
+
For example,
|
11
11
|
|
12
|
-
```
|
12
|
+
```text
|
13
13
|
3**2 + 4**2 = 9 + 16 = 25 = 5**2.
|
14
14
|
```
|
15
15
|
|
@@ -17,13 +17,12 @@ There exists exactly one Pythagorean triplet for which a + b + c = 1000.
|
|
17
17
|
|
18
18
|
Find the product a * b * c.
|
19
19
|
|
20
|
-
|
20
|
+
## Submitting Exercises
|
21
21
|
|
22
22
|
Note that, when trying to submit an exercise, make sure the solution is in the `exercism/python/<exerciseName>` directory.
|
23
23
|
|
24
24
|
For example, if you're submitting `bob.py` for the Bob exercise, the submit command would be something like `exercism submit <path_to_exercism_dir>/python/bob/bob.py`.
|
25
25
|
|
26
|
-
|
27
26
|
For more detailed information about running tests, code style and linting,
|
28
27
|
please see the [help page](http://exercism.io/languages/python).
|
29
28
|
|
@@ -11,7 +11,7 @@ A chessboard can be represented by an 8 by 8 array.
|
|
11
11
|
So if you're told the white queen is at (2, 3) and the black queen at
|
12
12
|
(5, 6), then you'd know you've got a set-up like so:
|
13
13
|
|
14
|
-
```
|
14
|
+
```text
|
15
15
|
_ _ _ _ _ _ _ _
|
16
16
|
_ _ _ _ _ _ _ _
|
17
17
|
_ _ _ W _ _ _ _
|
@@ -26,13 +26,12 @@ You'd also be able to answer whether the queens can attack each other.
|
|
26
26
|
In this case, that answer would be yes, they can, because both pieces
|
27
27
|
share a diagonal.
|
28
28
|
|
29
|
-
|
29
|
+
## Submitting Exercises
|
30
30
|
|
31
31
|
Note that, when trying to submit an exercise, make sure the solution is in the `exercism/python/<exerciseName>` directory.
|
32
32
|
|
33
33
|
For example, if you're submitting `bob.py` for the Bob exercise, the submit command would be something like `exercism submit <path_to_exercism_dir>/python/bob/bob.py`.
|
34
34
|
|
35
|
-
|
36
35
|
For more detailed information about running tests, code style and linting,
|
37
36
|
please see the [help page](http://exercism.io/languages/python).
|
38
37
|
|
@@ -11,41 +11,46 @@ Finally the message is then read off in rows.
|
|
11
11
|
|
12
12
|
For example, using three "rails" and the message "WE ARE DISCOVERED FLEE AT ONCE",
|
13
13
|
the cipherer writes out:
|
14
|
-
|
14
|
+
|
15
|
+
```text
|
15
16
|
W . . . E . . . C . . . R . . . L . . . T . . . E
|
16
17
|
. E . R . D . S . O . E . E . F . E . A . O . C .
|
17
18
|
. . A . . . I . . . V . . . D . . . E . . . N . .
|
18
19
|
```
|
19
20
|
|
20
21
|
Then reads off:
|
21
|
-
|
22
|
+
|
23
|
+
```text
|
22
24
|
WECRLTEERDSOEEFEAOCAIVDEN
|
23
25
|
```
|
24
26
|
|
25
|
-
|
26
27
|
To decrypt a message you take the zig-zag shape and fill the ciphertext along the rows.
|
27
|
-
|
28
|
+
|
29
|
+
```text
|
28
30
|
? . . . ? . . . ? . . . ? . . . ? . . . ? . . . ?
|
29
31
|
. ? . ? . ? . ? . ? . ? . ? . ? . ? . ? . ? . ? .
|
30
32
|
. . ? . . . ? . . . ? . . . ? . . . ? . . . ? . .
|
31
33
|
```
|
32
34
|
|
33
35
|
The first row has seven spots that can be filled with "WECRLTE".
|
34
|
-
|
36
|
+
|
37
|
+
```text
|
35
38
|
W . . . E . . . C . . . R . . . L . . . T . . . E
|
36
39
|
. ? . ? . ? . ? . ? . ? . ? . ? . ? . ? . ? . ? .
|
37
40
|
. . ? . . . ? . . . ? . . . ? . . . ? . . . ? . .
|
38
41
|
```
|
39
42
|
|
40
43
|
Now the 2nd row takes "ERDSOEEFEAOC".
|
41
|
-
|
44
|
+
|
45
|
+
```text
|
42
46
|
W . . . E . . . C . . . R . . . L . . . T . . . E
|
43
47
|
. E . R . D . S . O . E . E . F . E . A . O . C .
|
44
48
|
. . ? . . . ? . . . ? . . . ? . . . ? . . . ? . .
|
45
49
|
```
|
46
50
|
|
47
51
|
Leaving "AIVDEN" for the last row.
|
48
|
-
|
52
|
+
|
53
|
+
```text
|
49
54
|
W . . . E . . . C . . . R . . . L . . . T . . . E
|
50
55
|
. E . R . D . S . O . E . E . F . E . A . O . C .
|
51
56
|
. . A . . . I . . . V . . . D . . . E . . . N . .
|
@@ -53,13 +58,12 @@ W . . . E . . . C . . . R . . . L . . . T . . . E
|
|
53
58
|
|
54
59
|
If you now read along the zig-zag shape you can read the original message.
|
55
60
|
|
56
|
-
|
61
|
+
## Submitting Exercises
|
57
62
|
|
58
63
|
Note that, when trying to submit an exercise, make sure the solution is in the `exercism/python/<exerciseName>` directory.
|
59
64
|
|
60
65
|
For example, if you're submitting `bob.py` for the Bob exercise, the submit command would be something like `exercism submit <path_to_exercism_dir>/python/bob/bob.py`.
|
61
66
|
|
62
|
-
|
63
67
|
For more detailed information about running tests, code style and linting,
|
64
68
|
please see the [help page](http://exercism.io/languages/python).
|
65
69
|
|
@@ -17,13 +17,12 @@ Convert a number to a string, the contents of which depend on the number's facto
|
|
17
17
|
- 34 has four factors: 1, 2, 17, and 34.
|
18
18
|
- In raindrop-speak, this would be "34".
|
19
19
|
|
20
|
-
|
20
|
+
## Submitting Exercises
|
21
21
|
|
22
22
|
Note that, when trying to submit an exercise, make sure the solution is in the `exercism/python/<exerciseName>` directory.
|
23
23
|
|
24
24
|
For example, if you're submitting `bob.py` for the Bob exercise, the submit command would be something like `exercism submit <path_to_exercism_dir>/python/bob/bob.py`.
|
25
25
|
|
26
|
-
|
27
26
|
For more detailed information about running tests, code style and linting,
|
28
27
|
please see the [help page](http://exercism.io/languages/python).
|
29
28
|
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Count the rectangles in an ASCII diagram like the one below.
|
4
4
|
|
5
|
-
```
|
5
|
+
```text
|
6
6
|
+--+
|
7
7
|
++ |
|
8
8
|
+-++--+
|
@@ -12,7 +12,7 @@ Count the rectangles in an ASCII diagram like the one below.
|
|
12
12
|
|
13
13
|
The above diagram contains 6 rectangles:
|
14
14
|
|
15
|
-
```
|
15
|
+
```text
|
16
16
|
|
17
17
|
|
18
18
|
+-----+
|
@@ -20,7 +20,7 @@ The above diagram contains 6 rectangles:
|
|
20
20
|
+-----+
|
21
21
|
```
|
22
22
|
|
23
|
-
```
|
23
|
+
```text
|
24
24
|
+--+
|
25
25
|
| |
|
26
26
|
| |
|
@@ -28,7 +28,7 @@ The above diagram contains 6 rectangles:
|
|
28
28
|
+--+
|
29
29
|
```
|
30
30
|
|
31
|
-
```
|
31
|
+
```text
|
32
32
|
+--+
|
33
33
|
| |
|
34
34
|
+--+
|
@@ -36,7 +36,7 @@ The above diagram contains 6 rectangles:
|
|
36
36
|
|
37
37
|
```
|
38
38
|
|
39
|
-
```
|
39
|
+
```text
|
40
40
|
|
41
41
|
|
42
42
|
+--+
|
@@ -44,7 +44,7 @@ The above diagram contains 6 rectangles:
|
|
44
44
|
+--+
|
45
45
|
```
|
46
46
|
|
47
|
-
```
|
47
|
+
```text
|
48
48
|
|
49
49
|
|
50
50
|
+--+
|
@@ -52,7 +52,7 @@ The above diagram contains 6 rectangles:
|
|
52
52
|
+--+
|
53
53
|
```
|
54
54
|
|
55
|
-
```
|
55
|
+
```text
|
56
56
|
|
57
57
|
++
|
58
58
|
++
|
@@ -63,13 +63,12 @@ The above diagram contains 6 rectangles:
|
|
63
63
|
You may assume that the input is always a proper rectangle (i.e. the length of
|
64
64
|
every line equals the length of the first line).
|
65
65
|
|
66
|
-
|
66
|
+
## Submitting Exercises
|
67
67
|
|
68
68
|
Note that, when trying to submit an exercise, make sure the solution is in the `exercism/python/<exerciseName>` directory.
|
69
69
|
|
70
70
|
For example, if you're submitting `bob.py` for the Bob exercise, the submit command would be something like `exercism submit <path_to_exercism_dir>/python/bob/bob.py`.
|
71
71
|
|
72
|
-
|
73
72
|
For more detailed information about running tests, code style and linting,
|
74
73
|
please see the [help page](http://exercism.io/languages/python).
|
75
74
|
|