Bläddra i källkod

Regenerate all READMEs

Stuart Kent 9 år sedan
förälder
incheckning
ae9feebdaf
57 ändrade filer med 232 tillägg och 192 borttagningar
  1. 0
    3
      exercises/accumulate/README.md
  2. 0
    1
      exercises/acronym/README.md
  3. 1
    1
      exercises/all-your-base/README.md
  4. 0
    1
      exercises/allergies/README.md
  5. 2
    1
      exercises/atbash-cipher/README.md
  6. 1
    1
      exercises/beer-song/README.md
  7. 2
    0
      exercises/binary/README.md
  8. 5
    5
      exercises/book-store/README.md
  9. 20
    6
      exercises/bowling/README.md
  10. 1
    1
      exercises/change/README.md
  11. 13
    6
      exercises/circular-buffer/README.md
  12. 1
    1
      exercises/collatz-conjecture/README.md
  13. 27
    0
      exercises/complex-numbers/README.md
  14. 10
    8
      exercises/crypto-square/README.md
  15. 6
    6
      exercises/diamond/README.md
  16. 2
    0
      exercises/etl/README.md
  17. 1
    2
      exercises/flatten-array/README.md
  18. 1
    1
      exercises/food-chain/README.md
  19. 0
    1
      exercises/grade-school/README.md
  20. 1
    2
      exercises/house/README.md
  21. 2
    1
      exercises/isogram/README.md
  22. 13
    13
      exercises/kindergarten-garden/README.md
  23. 10
    10
      exercises/linked-list/README.md
  24. 4
    0
      exercises/list-ops/README.md
  25. 7
    7
      exercises/luhn/README.md
  26. 6
    4
      exercises/matrix/README.md
  27. 1
    2
      exercises/meetup/README.md
  28. 8
    22
      exercises/nucleotide-count/README.md
  29. 5
    5
      exercises/ocr-numbers/README.md
  30. 6
    2
      exercises/octal/README.md
  31. 15
    16
      exercises/palindrome-products/README.md
  32. 1
    1
      exercises/pangram/README.md
  33. 1
    1
      exercises/pascals-triangle/README.md
  34. 2
    2
      exercises/perfect-numbers/README.md
  35. 3
    2
      exercises/phone-number/README.md
  36. 3
    3
      exercises/pythagorean-triplet/README.md
  37. 1
    1
      exercises/queen-attack/README.md
  38. 7
    7
      exercises/rectangles/README.md
  39. 1
    1
      exercises/roman-numerals/README.md
  40. 2
    1
      exercises/rotational-cipher/README.md
  41. 4
    4
      exercises/run-length-encoding/README.md
  42. 1
    1
      exercises/saddle-points/README.md
  43. 3
    1
      exercises/scrabble-score/README.md
  44. 1
    1
      exercises/secret-handshake/README.md
  45. 1
    1
      exercises/simple-cipher/README.md
  46. 1
    1
      exercises/space-age/README.md
  47. 2
    2
      exercises/spiral-matrix/README.md
  48. 0
    3
      exercises/sum-of-multiples/README.md
  49. 6
    5
      exercises/tournament/README.md
  50. 7
    7
      exercises/transpose/README.md
  51. 9
    6
      exercises/triangle/README.md
  52. 1
    1
      exercises/trinary/README.md
  53. 1
    1
      exercises/twelve-days/README.md
  54. 1
    2
      exercises/two-fer/README.md
  55. 1
    2
      exercises/word-count/README.md
  56. 1
    1
      exercises/word-search/README.md
  57. 0
    5
      exercises/wordy/README.md

+ 0
- 3
exercises/accumulate/README.md Visa fil

25
 provided by your standard library!
25
 provided by your standard library!
26
 Solve this one yourself using other basic tools instead.
26
 Solve this one yourself using other basic tools instead.
27
 
27
 
28
-Lisp specific: it's perfectly fine to use `MAPCAR` or the equivalent,
29
-as this is idiomatic Lisp, not a library function.
30
-
31
 
28
 
32
 To run the tests:
29
 To run the tests:
33
 
30
 

+ 0
- 1
exercises/acronym/README.md Visa fil

8
 like Portable Network Graphics to its acronym (PNG).
8
 like Portable Network Graphics to its acronym (PNG).
9
 
9
 
10
 
10
 
11
-
12
 To run the tests:
11
 To run the tests:
13
 
12
 
14
 ```sh
13
 ```sh

+ 1
- 1
exercises/all-your-base/README.md Visa fil

6
 represented as a sequence of digits, convert it to base **b**.
6
 represented as a sequence of digits, convert it to base **b**.
7
 
7
 
8
 ## Note
8
 ## Note
9
+
9
 - Try to implement the conversion yourself.
10
 - Try to implement the conversion yourself.
10
   Do not use something else to perform the conversion for you.
11
   Do not use something else to perform the conversion for you.
11
 
12
 
28
 
29
 
29
 I think you got the idea!
30
 I think you got the idea!
30
 
31
 
31
-
32
 *Yes. Those three numbers above are exactly the same. Congratulations!*
32
 *Yes. Those three numbers above are exactly the same. Congratulations!*
33
 
33
 
34
 
34
 

+ 0
- 1
exercises/allergies/README.md Visa fil

30
 score is 257, your program should only report the eggs (1) allergy.
30
 score is 257, your program should only report the eggs (1) allergy.
31
 
31
 
32
 
32
 
33
-
34
 To run the tests:
33
 To run the tests:
35
 
34
 
36
 ```sh
35
 ```sh

+ 2
- 1
exercises/atbash-cipher/README.md Visa fil

9
 
9
 
10
 An Atbash cipher for the Latin alphabet would be as follows:
10
 An Atbash cipher for the Latin alphabet would be as follows:
11
 
11
 
12
-```plain
12
+```text
13
 Plain:  abcdefghijklmnopqrstuvwxyz
13
 Plain:  abcdefghijklmnopqrstuvwxyz
14
 Cipher: zyxwvutsrqponmlkjihgfedcba
14
 Cipher: zyxwvutsrqponmlkjihgfedcba
15
 ```
15
 ```
23
 things based on word boundaries.
23
 things based on word boundaries.
24
 
24
 
25
 ## Examples
25
 ## Examples
26
+
26
 - Encoding `test` gives `gvhg`
27
 - Encoding `test` gives `gvhg`
27
 - Decoding `gvhg` gives `test`
28
 - Decoding `gvhg` gives `test`
28
 - Decoding `gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt` gives `thequickbrownfoxjumpsoverthelazydog`
29
 - Decoding `gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt` gives `thequickbrownfoxjumpsoverthelazydog`

+ 1
- 1
exercises/beer-song/README.md Visa fil

4
 
4
 
5
 Note that not all verses are identical.
5
 Note that not all verses are identical.
6
 
6
 
7
-```plain
7
+```text
8
 99 bottles of beer on the wall, 99 bottles of beer.
8
 99 bottles of beer on the wall, 99 bottles of beer.
9
 Take one down and pass it around, 98 bottles of beer on the wall.
9
 Take one down and pass it around, 98 bottles of beer on the wall.
10
 
10
 

+ 2
- 0
exercises/binary/README.md Visa fil

7
 program should handle invalid inputs.
7
 program should handle invalid inputs.
8
 
8
 
9
 ## Note
9
 ## Note
10
+
10
 - Implement the conversion yourself.
11
 - Implement the conversion yourself.
11
   Do not use something else to perform the conversion for you.
12
   Do not use something else to perform the conversion for you.
12
 
13
 
13
 ## About Binary (Base-2)
14
 ## About Binary (Base-2)
15
+
14
 Decimal is a base-10 system.
16
 Decimal is a base-10 system.
15
 
17
 
16
 A number 23 in base 10 notation can be understood
18
 A number 23 in base 10 notation can be understood

+ 5
- 5
exercises/book-store/README.md Visa fil

3
 To try and encourage more sales of different books from a popular 5 book
3
 To try and encourage more sales of different books from a popular 5 book
4
 series, a bookshop has decided to offer discounts on multiple book purchases.
4
 series, a bookshop has decided to offer discounts on multiple book purchases.
5
 
5
 
6
-One copy of any of the five books costs $8. 
6
+One copy of any of the five books costs $8.
7
 
7
 
8
 If, however, you buy two different books, you get a 5%
8
 If, however, you buy two different books, you get a 5%
9
 discount on those two books.
9
 discount on those two books.
10
 
10
 
11
-If you buy 3 different books, you get a 10% discount. 
11
+If you buy 3 different books, you get a 10% discount.
12
 
12
 
13
 If you buy 4 different books, you get a 20% discount.
13
 If you buy 4 different books, you get a 20% discount.
14
 
14
 
15
-If you buy all 5, you get a 25% discount. 
15
+If you buy all 5, you get a 25% discount.
16
 
16
 
17
 Note: that if you buy four books, of which 3 are
17
 Note: that if you buy four books, of which 3 are
18
 different titles, you get a 10% discount on the 3 that
18
 different titles, you get a 10% discount on the 3 that
19
-form part of a set, but the fourth book still costs $8. 
19
+form part of a set, but the fourth book still costs $8.
20
 
20
 
21
 Your mission is to write a piece of code to calculate the
21
 Your mission is to write a piece of code to calculate the
22
 price of any conceivable shopping basket (containing only
22
 price of any conceivable shopping basket (containing only
30
 - 2 copies of the third book
30
 - 2 copies of the third book
31
 - 1 copy of the fourth book
31
 - 1 copy of the fourth book
32
 - 1 copy of the fifth book
32
 - 1 copy of the fifth book
33
- 
33
+
34
 One way of grouping these 8 books is:
34
 One way of grouping these 8 books is:
35
 
35
 
36
 - 1 group of 5 --> 25% discount (1st,2nd,3rd,4th,5th)
36
 - 1 group of 5 --> 25% discount (1st,2nd,3rd,4th,5th)

+ 20
- 6
exercises/bowling/README.md Visa fil

2
 
2
 
3
 Score a bowling game.
3
 Score a bowling game.
4
 
4
 
5
-Bowling is game where players roll a heavy ball to knock down pins
5
+Bowling is a game where players roll a heavy ball to knock down pins
6
 arranged in a triangle. Write code to keep track of the score
6
 arranged in a triangle. Write code to keep track of the score
7
 of a game of bowling.
7
 of a game of bowling.
8
 
8
 
9
 ## Scoring Bowling
9
 ## Scoring Bowling
10
 
10
 
11
-The game consists of 10 frames. A frame is composed of one or two ball throws with 10 pins standing at frame initialization. There are three cases for the tabulation of a frame.
11
+The game consists of 10 frames. A frame is composed of one or two ball
12
+throws with 10 pins standing at frame initialization. There are three
13
+cases for the tabulation of a frame.
12
 
14
 
13
-* An open frame is where a score of less than 10 is recorded for the frame. In this case the score for the frame is the number of pins knocked down.
15
+* An open frame is where a score of less than 10 is recorded for the
16
+  frame. In this case the score for the frame is the number of pins
17
+  knocked down.
14
 
18
 
15
-* A spare is where all ten pins are knocked down after the second throw. The total value of a spare is 10 plus the number of pins knocked down in their next throw.
19
+* A spare is where all ten pins are knocked down by the second
20
+  throw. The total value of a spare is 10 plus the number of pins
21
+  knocked down in their next throw.
16
 
22
 
17
-* A strike is where all ten pins are knocked down after the first throw. The total value of a strike is 10 plus the number of pins knocked down in their next two throws. If a strike is immediately followed by a second strike, then we can not total the value of first strike until they throw the ball one more time.
23
+* A strike is where all ten pins are knocked down by the first
24
+  throw. The total value of a strike is 10 plus the number of pins
25
+  knocked down in the next two throws. If a strike is immediately
26
+  followed by a second strike, then the value of the first strike
27
+  cannot be determined until the ball is thrown one more time.
18
 
28
 
19
 Here is a three frame example:
29
 Here is a three frame example:
20
 
30
 
30
 
40
 
31
 This means the current running total is 48.
41
 This means the current running total is 48.
32
 
42
 
33
-The tenth frame in the game is a special case. If someone throws a strike or a spare then they get a fill ball. Fill balls exist to calculate the total of the 10th frame. Scoring a strike or spare on the fill ball does not give the player more fill balls. The total value of the 10th frame is the total number of pins knocked down.
43
+The tenth frame in the game is a special case. If someone throws a
44
+strike or a spare then they get a fill ball. Fill balls exist to
45
+calculate the total of the 10th frame. Scoring a strike or spare on
46
+the fill ball does not give the player more fill balls. The total
47
+value of the 10th frame is the total number of pins knocked down.
34
 
48
 
35
 For a tenth frame of X1/ (strike and a spare), the total value is 20.
49
 For a tenth frame of X1/ (strike and a spare), the total value is 20.
36
 
50
 

+ 1
- 1
exercises/change/README.md Visa fil

28
 
28
 
29
 ## Source
29
 ## Source
30
 
30
 
31
-Software Craftsmanship - Kata-logue [http://craftsmanship.sv.cmu.edu/exercises/coin-change-kata](http://craftsmanship.sv.cmu.edu/exercises/coin-change-kata)
31
+Software Craftsmanship - Coin Change Kata [https://web.archive.org/web/20130115115225/http://craftsmanship.sv.cmu.edu:80/exercises/coin-change-kata](https://web.archive.org/web/20130115115225/http://craftsmanship.sv.cmu.edu:80/exercises/coin-change-kata)
32
 
32
 
33
 ## Submitting Incomplete Solutions
33
 ## Submitting Incomplete Solutions
34
 It's possible to submit an incomplete solution so you can see how others have completed the exercise.
34
 It's possible to submit an incomplete solution so you can see how others have completed the exercise.

+ 13
- 6
exercises/circular-buffer/README.md Visa fil

31
 When the buffer is full an error will be raised, alerting the client
31
 When the buffer is full an error will be raised, alerting the client
32
 that further writes are blocked until a slot becomes free.
32
 that further writes are blocked until a slot becomes free.
33
 
33
 
34
-The client can opt to overwrite the oldest data with a forced write. In
35
-this case, two more elements — A & B — are added and they overwrite the
36
-3 & 4:
34
+When the buffer is full, the client can opt to overwrite the oldest
35
+data with a forced write. In this case, two more elements — A & B —
36
+are added and they overwrite the 3 & 4:
37
 
37
 
38
     [6][7][8][9][A][B][5]
38
     [6][7][8][9][A][B][5]
39
 
39
 
40
-Finally, if two elements are now removed then what would be returned is
41
-not 3 & 4 but 5 & 6 because A & B overwrote the 3 & the 4 yielding the
42
-buffer with:
40
+3 & 4 have been replaced by A & B making 5 now the oldest data in the
41
+buffer. Finally, if two elements are removed then what would be
42
+returned is 5 & 6 yielding the buffer:
43
 
43
 
44
     [ ][7][8][9][A][B][ ]
44
     [ ][7][8][9][A][B][ ]
45
 
45
 
46
+Because there is space available, if the client again uses overwrite
47
+to store C & D then the space where 5 & 6 were stored previously will
48
+be used not the location of 7 & 8. 7 is still the oldest element and
49
+the buffer is once again full.
50
+
51
+    [D][7][8][9][A][B][C]
52
+
46
 
53
 
47
 To run the tests:
54
 To run the tests:
48
 
55
 

+ 1
- 1
exercises/collatz-conjecture/README.md Visa fil

10
 Given a number n, return the number of steps required to reach 1.
10
 Given a number n, return the number of steps required to reach 1.
11
 
11
 
12
 ## Examples
12
 ## Examples
13
+
13
 Starting with n = 12, the steps would be as follows:
14
 Starting with n = 12, the steps would be as follows:
14
 
15
 
15
 0. 12
16
 0. 12
26
 Resulting in 9 steps. So for input n = 12, the return value would be 9.
27
 Resulting in 9 steps. So for input n = 12, the return value would be 9.
27
 
28
 
28
 
29
 
29
-
30
 To run the tests:
30
 To run the tests:
31
 
31
 
32
 ```sh
32
 ```sh

+ 27
- 0
exercises/complex-numbers/README.md Visa fil

2
 
2
 
3
 A complex number is a number in the form `a + b * i` where `a` and `b` are real and `i` satisfies `i^2 = -1`.
3
 A complex number is a number in the form `a + b * i` where `a` and `b` are real and `i` satisfies `i^2 = -1`.
4
 
4
 
5
+`a` is called the real part and `b` is called the imaginary part of `z`.
6
+The conjugate of the number `a + b * i` is the number `a - b * i`.
7
+The absolute value of a complex number `z = a + b * i` is a real number `|z| = sqrt(a^2 + b^2)`. The square of the absolute value `|z|^2` is the result of multiplication of `z` by its complex conjugate.
8
+
9
+The sum/difference of two complex numbers involves adding/subtracting their real and imaginary parts separately:
10
+`(a + i * b) + (c + i * d) = (a + c) + (b + d) * i`,
11
+`(a + i * b) - (c + i * d) = (a - c) + (b - d) * i`.
12
+
13
+Multiplication result is by definition
14
+`(a + i * b) * (c + i * d) = (a * c - b * d) + (b * c + a * d) * i`.
15
+
16
+The reciprocal of a non-zero complex number is
17
+`1 / (a + i * b) = a/(a^2 + b^2) - b/(a^2 + b^2) * i`.
18
+
19
+Dividing a complex number `a + i * b` by another `c + i * d` gives:
20
+`(a + i * b) / (c + i * d) = (a * c + b * d)/(c^2 + d^2) + (b * c - a * d)/(c^2 + d^2) * i`.
21
+
22
+Exponent of a complex number can be expressed as
23
+`exp(a + i * b) = exp(a) * exp(i * b)`,
24
+and the last term is given by Euler's formula `exp(i * b) = cos(b) + i * sin(b)`.
25
+
26
+
27
+Implement the following operations:
28
+ - addition, subtraction, multiplication and division of two complex numbers,
29
+ - conjugate, absolute value, exponent of a given complex number.
30
+
31
+
5
 Assume the programming language you are using does not have an implementation of complex numbers.
32
 Assume the programming language you are using does not have an implementation of complex numbers.
6
 
33
 
7
 
34
 

+ 10
- 8
exercises/crypto-square/README.md Visa fil

26
 Our normalized text is 54 characters long, dictating a rectangle with
26
 Our normalized text is 54 characters long, dictating a rectangle with
27
 `c = 8` and `r = 7`:
27
 `c = 8` and `r = 7`:
28
 
28
 
29
-```plain
29
+```text
30
 ifmanwas
30
 ifmanwas
31
 meanttos
31
 meanttos
32
 tayonthe
32
 tayonthe
41
 
41
 
42
 The message above is coded as:
42
 The message above is coded as:
43
 
43
 
44
-```plain
44
+```text
45
 imtgdvsfearwermayoogoanouuiontnnlvtwttddesaohghnsseoau
45
 imtgdvsfearwermayoogoanouuiontnnlvtwttddesaohghnsseoau
46
 ```
46
 ```
47
 
47
 
48
-Output the encoded text in chunks.  Phrases that fill perfect squares
49
-`(r X r)` should be output in `r`-length chunks separated by spaces.
50
-Imperfect squares will have `n` empty spaces.  Those spaces should be distributed evenly across the last `n` rows.
48
+Output the encoded text in chunks.  Phrases that fill perfect rectangles
49
+`(r X c)` should be output `c` chunks of `r` length, separated by spaces.
50
+Phrases that do not fill perfect rectangles will have `n` empty spaces.
51
+Those spaces should be distributed evenly, added to the end of the last
52
+`n` chunks.
51
 
53
 
52
-```plain
53
-imtgdvs fearwer mayoogo anouuio ntnnlvt wttddes aohghn sseoau
54
+```text
55
+imtgdvs fearwer mayoogo anouuio ntnnlvt wttddes aohghn  sseoau 
54
 ```
56
 ```
55
 
57
 
56
 Notice that were we to stack these, we could visually decode the
58
 Notice that were we to stack these, we could visually decode the
57
 cyphertext back in to the original message:
59
 cyphertext back in to the original message:
58
 
60
 
59
-```plain
61
+```text
60
 imtgdvs
62
 imtgdvs
61
 fearwer
63
 fearwer
62
 mayoogo
64
 mayoogo

+ 6
- 6
exercises/diamond/README.md Visa fil

1
 # Diamond
1
 # Diamond
2
 
2
 
3
-The diamond kata takes as its input a letter, and outputs it in a diamond 
4
-shape. Given a letter, it prints a diamond starting with 'A', with the 
3
+The diamond kata takes as its input a letter, and outputs it in a diamond
4
+shape. Given a letter, it prints a diamond starting with 'A', with the
5
 supplied letter at the widest point.
5
 supplied letter at the widest point.
6
 
6
 
7
 ## Requirements
7
 ## Requirements
15
 * The diamond has a square shape (width equals height).
15
 * The diamond has a square shape (width equals height).
16
 * The letters form a diamond shape.
16
 * The letters form a diamond shape.
17
 * The top half has the letters in ascending order.
17
 * The top half has the letters in ascending order.
18
-* The bottom half has the letters in descending order. 
18
+* The bottom half has the letters in descending order.
19
 * The four corners (containing the spaces) are triangles.
19
 * The four corners (containing the spaces) are triangles.
20
 
20
 
21
 ## Examples
21
 ## Examples
24
 
24
 
25
 Diamond for letter 'A':
25
 Diamond for letter 'A':
26
 
26
 
27
-```plain
27
+```text
28
 A
28
 A
29
 ```
29
 ```
30
 
30
 
31
 Diamond for letter 'C':
31
 Diamond for letter 'C':
32
 
32
 
33
-```plain
33
+```text
34
 ··A··
34
 ··A··
35
 ·B·B·
35
 ·B·B·
36
 C···C
36
 C···C
40
 
40
 
41
 Diamond for letter 'E':
41
 Diamond for letter 'E':
42
 
42
 
43
-```plain
43
+```text
44
 ····A····
44
 ····A····
45
 ···B·B···
45
 ···B·B···
46
 ··C···C··
46
 ··C···C··

+ 2
- 0
exercises/etl/README.md Visa fil

3
 We are going to do the `Transform` step of an Extract-Transform-Load.
3
 We are going to do the `Transform` step of an Extract-Transform-Load.
4
 
4
 
5
 ### ETL
5
 ### ETL
6
+
6
 Extract-Transform-Load (ETL) is a fancy way of saying, "We have some crufty, legacy data over in this system, and now we need it in this shiny new system over here, so
7
 Extract-Transform-Load (ETL) is a fancy way of saying, "We have some crufty, legacy data over in this system, and now we need it in this shiny new system over here, so
7
 we're going to migrate this."
8
 we're going to migrate this."
8
 
9
 
11
 moaning about how stupid we could possibly be.)
12
 moaning about how stupid we could possibly be.)
12
 
13
 
13
 ### The goal
14
 ### The goal
15
+
14
 We're going to extract some scrabble scores from a legacy system.
16
 We're going to extract some scrabble scores from a legacy system.
15
 
17
 
16
 The old system stored a list of letters per score:
18
 The old system stored a list of letters per score:

+ 1
- 2
exercises/flatten-array/README.md Visa fil

3
 Take a nested list and return a single flattened list with all values except nil/null.
3
 Take a nested list and return a single flattened list with all values except nil/null.
4
 
4
 
5
 The challenge is to write a function that accepts an arbitrarily-deep nested list-like structure and returns a flattened structure without any nil/null values.
5
 The challenge is to write a function that accepts an arbitrarily-deep nested list-like structure and returns a flattened structure without any nil/null values.
6
- 
6
+
7
 For Example
7
 For Example
8
 
8
 
9
 input: [1,[2,3,null,4],[null],5]
9
 input: [1,[2,3,null,4],[null],5]
11
 output: [1,2,3,4,5]
11
 output: [1,2,3,4,5]
12
 
12
 
13
 
13
 
14
-
15
 To run the tests:
14
 To run the tests:
16
 
15
 
17
 ```sh
16
 ```sh

+ 1
- 1
exercises/food-chain/README.md Visa fil

10
 
10
 
11
 This is one of many common variants.
11
 This is one of many common variants.
12
 
12
 
13
-```plain
13
+```text
14
 I know an old lady who swallowed a fly.
14
 I know an old lady who swallowed a fly.
15
 I don't know why she swallowed the fly. Perhaps she'll die.
15
 I don't know why she swallowed the fly. Perhaps she'll die.
16
 
16
 

+ 0
- 1
exercises/grade-school/README.md Visa fil

21
 Note that all our students only have one name.  (It's a small town, what
21
 Note that all our students only have one name.  (It's a small town, what
22
 do you want?)
22
 do you want?)
23
 
23
 
24
-
25
 ## For bonus points
24
 ## For bonus points
26
 
25
 
27
 Did you get the tests passing and the code clean? If you want to, these
26
 Did you get the tests passing and the code clean? If you want to, these

+ 1
- 2
exercises/house/README.md Visa fil

11
 
11
 
12
 - [papyr.com](http://papyr.com/hypertextbooks/grammar/ph_noun.htm)
12
 - [papyr.com](http://papyr.com/hypertextbooks/grammar/ph_noun.htm)
13
 
13
 
14
-
15
 The nursery rhyme reads as follows:
14
 The nursery rhyme reads as follows:
16
 
15
 
17
-```plain
16
+```text
18
 This is the house that Jack built.
17
 This is the house that Jack built.
19
 
18
 
20
 This is the malt
19
 This is the malt

+ 2
- 1
exercises/isogram/README.md Visa fil

2
 
2
 
3
 Determine if a word or phrase is an isogram.
3
 Determine if a word or phrase is an isogram.
4
 
4
 
5
-An isogram (also known as a "nonpattern word") is a word or phrase without a repeating letter.
5
+An isogram (also known as a "nonpattern word") is a word or phrase without a repeating letter, however spaces and hyphens are allowed to appear multiple times.
6
 
6
 
7
 Examples of isograms:
7
 Examples of isograms:
8
 
8
 
9
 - lumberjacks
9
 - lumberjacks
10
 - background
10
 - background
11
 - downstream
11
 - downstream
12
+- six-year-old
12
 
13
 
13
 The word *isograms*, however, is not an isogram, because the s repeats.
14
 The word *isograms*, however, is not an isogram, because the s repeats.
14
 
15
 

+ 13
- 13
exercises/kindergarten-garden/README.md Visa fil

3
 Given a diagram, determine which plants each child in the kindergarten class is
3
 Given a diagram, determine which plants each child in the kindergarten class is
4
 responsible for.
4
 responsible for.
5
 
5
 
6
-The kindergarten class is learning about growing plants. The teachers
6
+The kindergarten class is learning about growing plants. The teacher
7
 thought it would be a good idea to give them actual seeds, plant them in
7
 thought it would be a good idea to give them actual seeds, plant them in
8
 actual dirt, and grow actual plants.
8
 actual dirt, and grow actual plants.
9
 
9
 
10
 They've chosen to grow grass, clover, radishes, and violets.
10
 They've chosen to grow grass, clover, radishes, and violets.
11
 
11
 
12
-To this end, they've put little styrofoam cups along the window sills,
13
-and planted one type of plant in each cup, choosing randomly from the
14
-available types of seeds.
12
+To this end, the children have put little cups along the window sills, and 
13
+planted one type of plant in each cup, choosing randomly from the available 
14
+types of seeds.
15
 
15
 
16
-```plain
16
+```text
17
 [window][window][window]
17
 [window][window][window]
18
-........................ # each dot represents a styrofoam cup
18
+........................ # each dot represents a cup
19
 ........................
19
 ........................
20
 ```
20
 ```
21
 
21
 
25
 - Eve, Fred, Ginny, Harriet,
25
 - Eve, Fred, Ginny, Harriet,
26
 - Ileana, Joseph, Kincaid, and Larry.
26
 - Ileana, Joseph, Kincaid, and Larry.
27
 
27
 
28
-Each child gets 4 cups, two on each row. The children are assigned to
29
-cups in alphabetical order.
28
+Each child gets 4 cups, two on each row. Their teacher assigns cups to 
29
+the children alphabetically by their names.
30
 
30
 
31
 The following diagram represents Alice's plants:
31
 The following diagram represents Alice's plants:
32
 
32
 
33
-```plain
33
+```text
34
 [window][window][window]
34
 [window][window][window]
35
 VR......................
35
 VR......................
36
 RG......................
36
 RG......................
37
 ```
37
 ```
38
 
38
 
39
-So in the row nearest the window, she has a violet and a radish; in the
40
-row behind that, she has a radish and some grass.
39
+In the first row, nearest the windows, she has a violet and a radish.  In the
40
+second row she has a radish and some grass.
41
 
41
 
42
 Your program will be given the plants from left-to-right starting with
42
 Your program will be given the plants from left-to-right starting with
43
 the row nearest the windows. From this, it should be able to determine
43
 the row nearest the windows. From this, it should be able to determine
44
-which plants belong to which students.
44
+which plants belong to each student.
45
 
45
 
46
 For example, if it's told that the garden looks like so:
46
 For example, if it's told that the garden looks like so:
47
 
47
 
48
-```plain
48
+```text
49
 [window][window][window]
49
 [window][window][window]
50
 VRCGVVRVCGGCCGVRGCVCGCGV
50
 VRCGVVRVCGGCCGVRGCVCGCGV
51
 VRCCCGCRRGVCGCRVVCVGCGCV
51
 VRCCCGCRRGVCGCRVVCVGCGCV

+ 10
- 10
exercises/linked-list/README.md Visa fil

2
 
2
 
3
 Implement a doubly linked list.
3
 Implement a doubly linked list.
4
 
4
 
5
-Like an array, a linked list is a simple linear data structure. Several 
6
-common data types can be implemented using linked lists, like queues, 
5
+Like an array, a linked list is a simple linear data structure. Several
6
+common data types can be implemented using linked lists, like queues,
7
 stacks, and associative arrays.
7
 stacks, and associative arrays.
8
 
8
 
9
-A linked list is a collection of data elements called *nodes*. In a 
10
-*singly linked list* each node holds a value and a link to the next node. 
11
-In a *doubly linked list* each node also holds a link to the previous 
9
+A linked list is a collection of data elements called *nodes*. In a
10
+*singly linked list* each node holds a value and a link to the next node.
11
+In a *doubly linked list* each node also holds a link to the previous
12
 node.
12
 node.
13
 
13
 
14
-You will write an implementation of a doubly linked list. Implement a 
15
-Node to hold a value and pointers to the next and previous nodes. Then 
16
-implement a List which holds references to the first and last node and 
14
+You will write an implementation of a doubly linked list. Implement a
15
+Node to hold a value and pointers to the next and previous nodes. Then
16
+implement a List which holds references to the first and last node and
17
 offers an array-like interface for adding and removing items:
17
 offers an array-like interface for adding and removing items:
18
 
18
 
19
 * `push` (*insert value at back*);
19
 * `push` (*insert value at back*);
21
 * `shift` (*remove value at front*).
21
 * `shift` (*remove value at front*).
22
 * `unshift` (*insert value at front*);
22
 * `unshift` (*insert value at front*);
23
 
23
 
24
-To keep your implementation simple, the tests will not cover error 
25
-conditions. Specifically: `pop` or `shift` will never be called on an 
24
+To keep your implementation simple, the tests will not cover error
25
+conditions. Specifically: `pop` or `shift` will never be called on an
26
 empty list.
26
 empty list.
27
 
27
 
28
 If you want to know more about linked lists, check [Wikipedia](https://en.wikipedia.org/wiki/Linked_list).
28
 If you want to know more about linked lists, check [Wikipedia](https://en.wikipedia.org/wiki/Linked_list).

+ 4
- 0
exercises/list-ops/README.md Visa fil

8
 
8
 
9
 ## Hints
9
 ## Hints
10
 
10
 
11
+In Java it's considered best practice to use instance methods over class methods. However, there are conditions in which it is absolutely appropriate for a function to be `static`. Since classes in Java are closed for modification (i.e. you cannot add members to a class outside its definition like you can in other languages like Ruby or JavaScript), you cannot add new behavior to the class directly. What to do if you still want to define behavior for a given type? The idiomatic solution in this case is to write a utility method. 
12
+Collections of these kinds of methods are often referred to as "utility classes". Examples of such classes from within the JRE include [Arrays](https://docs.oracle.com/javase/9/docs/api/java/util/Arrays.html) and [Collections](https://docs.oracle.com/javase/9/docs/api/java/util/Collections.html).
13
+In this exercise we want a List to have `map()`, `reduce()`, `filter()`, etc. methods. It doesn't, so we're using static methods.
14
+
11
 The `foldLeft` and `foldRight` methods are "fold" functions, which is a concept well-known in the functional programming world, but less so in the object-oriented one. See the Wikipedia page on folding for [general background](https://en.wikipedia.org/wiki/Fold_(higher-order_function)) and [signature/implementation hints](https://en.wikipedia.org/wiki/Fold_(higher-order_function)#Linear_folds).
15
 The `foldLeft` and `foldRight` methods are "fold" functions, which is a concept well-known in the functional programming world, but less so in the object-oriented one. See the Wikipedia page on folding for [general background](https://en.wikipedia.org/wiki/Fold_(higher-order_function)) and [signature/implementation hints](https://en.wikipedia.org/wiki/Fold_(higher-order_function)#Linear_folds).
12
 
16
 
13
 
17
 

+ 7
- 7
exercises/luhn/README.md Visa fil

18
 
18
 
19
 ## Example 1: valid credit card number
19
 ## Example 1: valid credit card number
20
 
20
 
21
-```
21
+```text
22
 4539 1488 0343 6467
22
 4539 1488 0343 6467
23
 ```
23
 ```
24
 
24
 
25
 The first step of the Luhn algorithm is to double every second digit,
25
 The first step of the Luhn algorithm is to double every second digit,
26
 starting from the right. We will be doubling
26
 starting from the right. We will be doubling
27
 
27
 
28
-```
28
+```text
29
 4_3_ 1_8_ 0_4_ 6_6_
29
 4_3_ 1_8_ 0_4_ 6_6_
30
 ```
30
 ```
31
 
31
 
32
 If doubling the number results in a number greater than 9 then subtract 9
32
 If doubling the number results in a number greater than 9 then subtract 9
33
 from the product. The results of our doubling:
33
 from the product. The results of our doubling:
34
 
34
 
35
-```
35
+```text
36
 8569 2478 0383 3437
36
 8569 2478 0383 3437
37
 ```
37
 ```
38
 
38
 
39
 Then sum all of the digits:
39
 Then sum all of the digits:
40
 
40
 
41
-```
41
+```text
42
 8+5+6+9+2+4+7+8+0+3+8+3+3+4+3+7 = 80
42
 8+5+6+9+2+4+7+8+0+3+8+3+3+4+3+7 = 80
43
 ```
43
 ```
44
 
44
 
46
 
46
 
47
 ## Example 2: invalid credit card number
47
 ## Example 2: invalid credit card number
48
 
48
 
49
-```
49
+```text
50
 8273 1232 7352 0569
50
 8273 1232 7352 0569
51
 ```
51
 ```
52
 
52
 
53
 Double the second digits, starting from the right
53
 Double the second digits, starting from the right
54
 
54
 
55
-```
55
+```text
56
 7253 2262 5312 0539
56
 7253 2262 5312 0539
57
 ```
57
 ```
58
 
58
 
59
 Sum the digits
59
 Sum the digits
60
 
60
 
61
-```
61
+```text
62
 7+2+5+3+2+2+6+2+5+3+1+2+0+5+3+9 = 57
62
 7+2+5+3+2+2+6+2+5+3+1+2+0+5+3+9 = 57
63
 ```
63
 ```
64
 
64
 

+ 6
- 4
exercises/matrix/README.md Visa fil

5
 
5
 
6
 So given a string with embedded newlines like:
6
 So given a string with embedded newlines like:
7
 
7
 
8
-> 9 8 7  
9
-> 5 3 2  
10
-> 6 6 7  
8
+```text
9
+9 8 7
10
+5 3 2
11
+6 6 7
12
+```
11
 
13
 
12
 representing this matrix:
14
 representing this matrix:
13
 
15
 
14
-```plain
16
+```text
15
     0  1  2
17
     0  1  2
16
   |---------
18
   |---------
17
 0 | 9  8  7
19
 0 | 9  8  7

+ 1
- 2
exercises/meetup/README.md Visa fil

18
 (Monday, Tuesday, ...) will have exactly one date that is named with '-teenth'
18
 (Monday, Tuesday, ...) will have exactly one date that is named with '-teenth'
19
 in every month.
19
 in every month.
20
 
20
 
21
-Given examples of a meetup dates, each containing a month, day, year, and descriptor 
21
+Given examples of a meetup dates, each containing a month, day, year, and descriptor
22
 (first, second, teenth, etc), calculate the date of the actual meetup.
22
 (first, second, teenth, etc), calculate the date of the actual meetup.
23
 For example, if given "First Monday of January 2017", the correct meetup date is 2017/1/2
23
 For example, if given "First Monday of January 2017", the correct meetup date is 2017/1/2
24
- 
25
 
24
 
26
 
25
 
27
 To run the tests:
26
 To run the tests:

+ 8
- 22
exercises/nucleotide-count/README.md Visa fil

1
 # Nucleotide Count
1
 # Nucleotide Count
2
 
2
 
3
-Given a DNA string, compute how many times each nucleotide occurs in the string.
3
+Given a single stranded DNA string, compute how many times each nucleotide occurs in the string.
4
 
4
 
5
-DNA is represented by an alphabet of the following symbols: 'A', 'C',
6
-'G', and 'T'.
7
-
8
-Each symbol represents a nucleotide, which is a fancy name for the
9
-particular molecules that happen to make up a large part of DNA.
10
-
11
-Shortest intro to biochemistry EVAR:
5
+The genetic language of every living thing on the planet is DNA. 
6
+DNA is a large molecule that is built from an extremely long sequence of individual elements called nucleotides. 
7
+4 types exist in DNA and these differ only slightly and can be represented as the following symbols: 'A' for adenine, 'C' for cytosine, 'G' for guanine, and 'T' thymine.
12
 
8
 
9
+Here is an analogy:
13
 - twigs are to birds nests as
10
 - twigs are to birds nests as
14
-- nucleotides are to DNA and RNA as
15
-- amino acids are to proteins as
16
-- sugar is to starch as
17
-- oh crap lipids
18
-
19
-I'm not going to talk about lipids because they're crazy complex.
20
-
21
-So back to nucleotides.
22
-
23
-DNA contains four types of them: adenine (`A`), cytosine (`C`), guanine
24
-(`G`), and thymine (`T`).
25
-
26
-RNA contains a slightly different set of nucleotides, but we don't care
27
-about that for now.
11
+- nucleotides are to DNA as
12
+- legos are to lego houses as
13
+- words are to sentences as...
28
 
14
 
29
 
15
 
30
 To run the tests:
16
 To run the tests:

+ 5
- 5
exercises/ocr-numbers/README.md Visa fil

9
 
9
 
10
 The binary font uses pipes and underscores, four rows high and three columns wide.
10
 The binary font uses pipes and underscores, four rows high and three columns wide.
11
 
11
 
12
-```
12
+```text
13
      _   #
13
      _   #
14
     | |  # zero.
14
     | |  # zero.
15
     |_|  #
15
     |_|  #
18
 
18
 
19
 Is converted to "0"
19
 Is converted to "0"
20
 
20
 
21
-```
21
+```text
22
          #
22
          #
23
       |  # one.
23
       |  # one.
24
       |  #
24
       |  #
39
 
39
 
40
 Update your program to recognize all numbers 0 through 9, both individually and as part of a larger string.
40
 Update your program to recognize all numbers 0 through 9, both individually and as part of a larger string.
41
 
41
 
42
-```
42
+```text
43
  _ 
43
  _ 
44
  _|
44
  _|
45
 |_ 
45
 |_ 
48
 
48
 
49
 Is converted to "2"
49
 Is converted to "2"
50
 
50
 
51
-```
51
+```text
52
       _  _     _  _  _  _  _  _  #
52
       _  _     _  _  _  _  _  _  #
53
     | _| _||_||_ |_   ||_||_|| | # decimal numbers.
53
     | _| _||_||_ |_   ||_||_|| | # decimal numbers.
54
     ||_  _|  | _||_|  ||_| _||_| #
54
     ||_  _|  | _||_|  ||_| _||_| #
61
 
61
 
62
 Update your program to handle multiple numbers, one per line. When converting several lines, join the lines with commas.
62
 Update your program to handle multiple numbers, one per line. When converting several lines, join the lines with commas.
63
 
63
 
64
-```
64
+```text
65
     _  _ 
65
     _  _ 
66
   | _| _|
66
   | _| _|
67
   ||_  _|
67
   ||_  _|

+ 6
- 2
exercises/octal/README.md Visa fil

8
 string, your program should produce a decimal output.
8
 string, your program should produce a decimal output.
9
 
9
 
10
 ## Note
10
 ## Note
11
+
11
 - Implement the conversion yourself.
12
 - Implement the conversion yourself.
12
   Do not use something else to perform the conversion for you.
13
   Do not use something else to perform the conversion for you.
13
 - Treat invalid input as octal 0.
14
 - Treat invalid input as octal 0.
14
 
15
 
15
 ## About Octal (Base-8)
16
 ## About Octal (Base-8)
17
+
16
 Decimal is a base-10 system.
18
 Decimal is a base-10 system.
17
 
19
 
18
 A number 233 in base 10 notation can be understood
20
 A number 233 in base 10 notation can be understood
25
 - All these values are summed.
27
 - All these values are summed.
26
 
28
 
27
 So:
29
 So:
28
-```
30
+
31
+```text
29
    233 # decimal
32
    233 # decimal
30
  = 2*10^2 + 3*10^1 + 3*10^0
33
  = 2*10^2 + 3*10^1 + 3*10^0
31
  = 2*100  + 3*10   + 3*1
34
  = 2*100  + 3*10   + 3*1
34
 Octal is similar, but uses powers of 8 rather than powers of 10.
37
 Octal is similar, but uses powers of 8 rather than powers of 10.
35
 
38
 
36
 So:
39
 So:
37
-```
40
+
41
+```text
38
    233 # octal
42
    233 # octal
39
  = 2*8^2 + 3*8^1 + 3*8^0
43
  = 2*8^2 + 3*8^1 + 3*8^0
40
  = 2*64  + 3*8   + 3*1
44
  = 2*64  + 3*8   + 3*1

+ 15
- 16
exercises/palindrome-products/README.md Visa fil

5
 A palindromic number is a number that remains the same when its digits are
5
 A palindromic number is a number that remains the same when its digits are
6
 reversed. For example, `121` is a palindromic number but `112` is not.
6
 reversed. For example, `121` is a palindromic number but `112` is not.
7
 
7
 
8
-Given the definition of a palindromic number, we define a palindrome _product_
9
-to be the product `c`, such that `a * b = c`, where `c` is a palindromic number and
10
- `a` and `b` are integers (possibly, but _not_ necessarily palindromic numbers).
8
+Given a range of numbers, find the largest and smallest palindromes which
9
+are products of numbers within that range.
11
 
10
 
12
-For example, the palindromic number 9009 can be written as the palindrome
13
-product: `91 * 99 = 9009`.
14
-
15
-It's possible (and indeed common) for a palindrome product to be the product
16
-of multiple combinations of numbers. For example, the palindrome product `9` has
17
-the factors `(1, 9)`, `(3, 3)`, and `(9, 1)`.
18
-
19
-Write a program that given a range of integers, returns the smallest and largest
20
-palindromic product within that range, along with all of it's factors.
11
+Your solution should return the largest and smallest palindromes, along with the
12
+factors of each within the range. If the largest or smallest palindrome has more 
13
+than one pair of factors within the range, then return all the pairs.
21
 
14
 
22
 ## Example 1
15
 ## Example 1
23
 
16
 
24
 Given the range `[1, 9]` (both inclusive)...
17
 Given the range `[1, 9]` (both inclusive)...
25
 
18
 
26
-The smallest product is `1`. It's factors are `(1, 1)`.
27
-The largest product is `9`. It's factors are `(1, 9)`, `(3, 3)`, and `(9, 1)`.
19
+And given the list of all possible products within this range:
20
+`[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 16, 18, 15, 21, 24, 27, 20, 28, 32, 36, 25, 30, 35, 40, 45, 42, 48, 54, 49, 56, 63, 64, 72, 81]`
21
+
22
+The palindrome products are all single digit numbers (in this case):
23
+`[1, 2, 3, 4, 5, 6, 7, 8, 9]`
24
+
25
+The smallest palindrome product is `1`. Its factors are `(1, 1)`.
26
+The largest palindrome product is `9`. Its factors are `(1, 9)` and `(3, 3)`.
28
 
27
 
29
 ## Example 2
28
 ## Example 2
30
 
29
 
31
 Given the range `[10, 99]` (both inclusive)...
30
 Given the range `[10, 99]` (both inclusive)...
32
 
31
 
33
-The smallest palindrome product is `121`. It's factors are `(11, 11)`.
34
-The largest palindrome product is `9009`. It's factors are `(91, 99)` and `(99, 91)`.
32
+The smallest palindrome product is `121`. Its factors are `(11, 11)`.
33
+The largest palindrome product is `9009`. Its factors are `(91, 99)`.
35
 
34
 
36
 
35
 
37
 To run the tests:
36
 To run the tests:

+ 1
- 1
exercises/pangram/README.md Visa fil

2
 
2
 
3
 Determine if a sentence is a pangram. A pangram (Greek: παν γράμμα, pan gramma,
3
 Determine if a sentence is a pangram. A pangram (Greek: παν γράμμα, pan gramma,
4
 "every letter") is a sentence using every letter of the alphabet at least once.
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
 > The quick brown fox jumps over the lazy dog.
6
 > The quick brown fox jumps over the lazy dog.
7
 
7
 
8
 The alphabet used consists of ASCII letters `a` to `z`, inclusive, and is case
8
 The alphabet used consists of ASCII letters `a` to `z`, inclusive, and is case

+ 1
- 1
exercises/pascals-triangle/README.md Visa fil

5
 In Pascal's Triangle each number is computed by adding the numbers to
5
 In Pascal's Triangle each number is computed by adding the numbers to
6
 the right and left of the current position in the previous row.
6
 the right and left of the current position in the previous row.
7
 
7
 
8
-```plain
8
+```text
9
     1
9
     1
10
    1 1
10
    1 1
11
   1 2 1
11
   1 2 1

+ 2
- 2
exercises/perfect-numbers/README.md Visa fil

5
 
5
 
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
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
   - 6 is a perfect number because (1 + 2 + 3) = 6
9
   - 6 is a perfect number because (1 + 2 + 3) = 6
10
   - 28 is a perfect number because (1 + 2 + 4 + 7 + 14) = 28
10
   - 28 is a perfect number because (1 + 2 + 4 + 7 + 14) = 28
11
 - **Abundant**: aliquot sum > number
11
 - **Abundant**: aliquot sum > number
14
 - **Deficient**: aliquot sum < number
14
 - **Deficient**: aliquot sum < number
15
   - 8 is a deficient number because (1 + 2 + 4) = 7
15
   - 8 is a deficient number because (1 + 2 + 4) = 7
16
   - Prime numbers are deficient
16
   - Prime numbers are deficient
17
-  
17
+
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**.
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
 

+ 3
- 2
exercises/phone-number/README.md Visa fil

6
 
6
 
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*.
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
 The format is usually represented as
9
 The format is usually represented as
11
-```
10
+
11
+```text
12
 (NXX)-NXX-XXXX
12
 (NXX)-NXX-XXXX
13
 ```
13
 ```
14
+
14
 where `N` is any digit from 2 through 9 and `X` is any digit from 0 through 9.
15
 where `N` is any digit from 2 through 9 and `X` is any digit from 0 through 9.
15
 
16
 
16
 Your task is to clean up differently formated telephone numbers by removing punctuation and the country code (1) if present.
17
 Your task is to clean up differently formated telephone numbers by removing punctuation and the country code (1) if present.

+ 3
- 3
exercises/pythagorean-triplet/README.md Visa fil

3
 A Pythagorean triplet is a set of three natural numbers, {a, b, c}, for
3
 A Pythagorean triplet is a set of three natural numbers, {a, b, c}, for
4
 which,
4
 which,
5
 
5
 
6
-```
6
+```text
7
 a**2 + b**2 = c**2
7
 a**2 + b**2 = c**2
8
 ```
8
 ```
9
 
9
 
10
-For example, 
10
+For example,
11
 
11
 
12
-```
12
+```text
13
 3**2 + 4**2 = 9 + 16 = 25 = 5**2.
13
 3**2 + 4**2 = 9 + 16 = 25 = 5**2.
14
 ```
14
 ```
15
 
15
 

+ 1
- 1
exercises/queen-attack/README.md Visa fil

11
 So if you're told the white queen is at (2, 3) and the black queen at
11
 So if you're told the white queen is at (2, 3) and the black queen at
12
 (5, 6), then you'd know you've got a set-up like so:
12
 (5, 6), then you'd know you've got a set-up like so:
13
 
13
 
14
-```plain
14
+```text
15
 _ _ _ _ _ _ _ _
15
 _ _ _ _ _ _ _ _
16
 _ _ _ _ _ _ _ _
16
 _ _ _ _ _ _ _ _
17
 _ _ _ W _ _ _ _
17
 _ _ _ W _ _ _ _

+ 7
- 7
exercises/rectangles/README.md Visa fil

2
 
2
 
3
 Count the rectangles in an ASCII diagram like the one below.
3
 Count the rectangles in an ASCII diagram like the one below.
4
 
4
 
5
-```
5
+```text
6
    +--+
6
    +--+
7
   ++  |
7
   ++  |
8
 +-++--+
8
 +-++--+
12
 
12
 
13
 The above diagram contains 6 rectangles:
13
 The above diagram contains 6 rectangles:
14
 
14
 
15
-```
15
+```text
16
 
16
 
17
 
17
 
18
 +-----+
18
 +-----+
20
 +-----+
20
 +-----+
21
 ```
21
 ```
22
 
22
 
23
-```
23
+```text
24
    +--+
24
    +--+
25
    |  |
25
    |  |
26
    |  |
26
    |  |
28
    +--+
28
    +--+
29
 ```
29
 ```
30
 
30
 
31
-```
31
+```text
32
    +--+
32
    +--+
33
    |  |
33
    |  |
34
    +--+
34
    +--+
36
 
36
 
37
 ```
37
 ```
38
 
38
 
39
-```
39
+```text
40
        
40
        
41
        
41
        
42
    +--+
42
    +--+
44
    +--+
44
    +--+
45
 ```
45
 ```
46
 
46
 
47
-```
47
+```text
48
        
48
        
49
        
49
        
50
 +--+
50
 +--+
52
 +--+
52
 +--+
53
 ```
53
 ```
54
 
54
 
55
-```
55
+```text
56
        
56
        
57
   ++   
57
   ++   
58
   ++   
58
   ++   

+ 1
- 1
exercises/roman-numerals/README.md Visa fil

14
 these letters have lots of straight lines and are hence easy to hack
14
 these letters have lots of straight lines and are hence easy to hack
15
 into stone tablets).
15
 into stone tablets).
16
 
16
 
17
-```
17
+```text
18
  1  => I
18
  1  => I
19
 10  => X
19
 10  => X
20
  7  => VII
20
  7  => VII

+ 2
- 1
exercises/rotational-cipher/README.md Visa fil

13
 
13
 
14
 A `ROT13` on the Latin alphabet would be as follows:
14
 A `ROT13` on the Latin alphabet would be as follows:
15
 
15
 
16
-```plain
16
+```text
17
 Plain:  abcdefghijklmnopqrstuvwxyz
17
 Plain:  abcdefghijklmnopqrstuvwxyz
18
 Cipher: nopqrstuvwxyzabcdefghijklm
18
 Cipher: nopqrstuvwxyzabcdefghijklm
19
 ```
19
 ```
23
 Ciphertext is written out in the same formatting as the input including spaces and punctuation.
23
 Ciphertext is written out in the same formatting as the input including spaces and punctuation.
24
 
24
 
25
 ## Examples
25
 ## Examples
26
+
26
 - ROT5  `omg` gives `trl`
27
 - ROT5  `omg` gives `trl`
27
 - ROT0  `c` gives `c`
28
 - ROT0  `c` gives `c`
28
 - ROT26 `Cool` gives `Cool`
29
 - ROT26 `Cool` gives `Cool`

+ 4
- 4
exercises/run-length-encoding/README.md Visa fil

7
 
7
 
8
 For example we can represent the original 53 characters with only 13.
8
 For example we can represent the original 53 characters with only 13.
9
 
9
 
10
-```
10
+```text
11
 "WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWB"  ->  "12WB12W3B24WB"
11
 "WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWB"  ->  "12WB12W3B24WB"
12
 ```
12
 ```
13
 
13
 
14
 RLE allows the original data to be perfectly reconstructed from
14
 RLE allows the original data to be perfectly reconstructed from
15
 the compressed data, which makes it a lossless data compression.
15
 the compressed data, which makes it a lossless data compression.
16
 
16
 
17
-```
17
+```text
18
 "AABCCCDEEEE"  ->  "2AB3CD4E"  ->  "AABCCCDEEEE"
18
 "AABCCCDEEEE"  ->  "2AB3CD4E"  ->  "AABCCCDEEEE"
19
 ```
19
 ```
20
 
20
 
21
 For simplicity, you can assume that the unencoded string will only contain
21
 For simplicity, you can assume that the unencoded string will only contain
22
-the letters A through Z (either lower or upper case) and whitespace. This way 
23
-data to be encoded will never contain any numbers and numbers inside data to 
22
+the letters A through Z (either lower or upper case) and whitespace. This way
23
+data to be encoded will never contain any numbers and numbers inside data to
24
 be decoded always represent the count for the following character.
24
 be decoded always represent the count for the following character.
25
 
25
 
26
 
26
 

+ 1
- 1
exercises/saddle-points/README.md Visa fil

4
 
4
 
5
 So say you have a matrix like so:
5
 So say you have a matrix like so:
6
 
6
 
7
-```plain
7
+```text
8
     0  1  2
8
     0  1  2
9
   |---------
9
   |---------
10
 0 | 9  8  7
10
 0 | 9  8  7

+ 3
- 1
exercises/scrabble-score/README.md Visa fil

6
 
6
 
7
 You'll need these:
7
 You'll need these:
8
 
8
 
9
-```plain
9
+```text
10
 Letter                           Value
10
 Letter                           Value
11
 A, E, I, O, U, L, N, R, S, T       1
11
 A, E, I, O, U, L, N, R, S, T       1
12
 D, G                               2
12
 D, G                               2
18
 ```
18
 ```
19
 
19
 
20
 ## Examples
20
 ## Examples
21
+
21
 "cabbage" should be scored as worth 14 points:
22
 "cabbage" should be scored as worth 14 points:
22
 
23
 
23
 - 3 points for C
24
 - 3 points for C
34
 - = 14
35
 - = 14
35
 
36
 
36
 ## Extensions
37
 ## Extensions
38
+
37
 - You can play a double or a triple letter.
39
 - You can play a double or a triple letter.
38
 - You can play a double or a triple word.
40
 - You can play a double or a triple word.
39
 
41
 

+ 1
- 1
exercises/secret-handshake/README.md Visa fil

6
 You and your fellow cohort of those in the "know" when it comes to
6
 You and your fellow cohort of those in the "know" when it comes to
7
 binary decide to come up with a secret "handshake".
7
 binary decide to come up with a secret "handshake".
8
 
8
 
9
-```
9
+```text
10
 1 = wink
10
 1 = wink
11
 10 = double blink
11
 10 = double blink
12
 100 = close your eyes
12
 100 = close your eyes

+ 1
- 1
exercises/simple-cipher/README.md Visa fil

47
 would return the original "iamapandabear".
47
 would return the original "iamapandabear".
48
 
48
 
49
 Given the key "ddddddddddddddddd", encoding our string "iamapandabear"
49
 Given the key "ddddddddddddddddd", encoding our string "iamapandabear"
50
-would return the obscured "lpdsdqgdehdu"
50
+would return the obscured "ldpdsdqgdehdu"
51
 
51
 
52
 In the example above, we've set a = 0 for the key value. So when the
52
 In the example above, we've set a = 0 for the key value. So when the
53
 plaintext is added to the key, we end up with the same message coming
53
 plaintext is added to the key, we end up with the same message coming

+ 1
- 1
exercises/space-age/README.md Visa fil

12
    - Neptune: orbital period 164.79132 Earth years
12
    - Neptune: orbital period 164.79132 Earth years
13
 
13
 
14
 So if you were told someone were 1,000,000,000 seconds old, you should
14
 So if you were told someone were 1,000,000,000 seconds old, you should
15
-be able to say that they're 31 Earth-years old.
15
+be able to say that they're 31.69 Earth-years old.
16
 
16
 
17
 If you're wondering why Pluto didn't make the cut, go watch [this
17
 If you're wondering why Pluto didn't make the cut, go watch [this
18
 youtube video](http://www.youtube.com/watch?v=Z_2gbGXzFbs).
18
 youtube video](http://www.youtube.com/watch?v=Z_2gbGXzFbs).

+ 2
- 2
exercises/spiral-matrix/README.md Visa fil

8
 
8
 
9
 ###### Spiral matrix of size 3
9
 ###### Spiral matrix of size 3
10
 
10
 
11
-```plain
11
+```text
12
 1 2 3
12
 1 2 3
13
 8 9 4
13
 8 9 4
14
 7 6 5
14
 7 6 5
16
 
16
 
17
 ###### Spiral matrix of size 4
17
 ###### Spiral matrix of size 4
18
 
18
 
19
-```plain
19
+```text
20
  1  2  3 4
20
  1  2  3 4
21
 12 13 14 5
21
 12 13 14 5
22
 11 16 15 6
22
 11 16 15 6

+ 0
- 3
exercises/sum-of-multiples/README.md Visa fil

8
 
8
 
9
 The sum of these multiples is 78.
9
 The sum of these multiples is 78.
10
 
10
 
11
-Given a number, find the sum of the multiples of a given set of numbers,
12
-up to but not including that number.
13
-
14
 
11
 
15
 To run the tests:
12
 To run the tests:
16
 
13
 

+ 6
- 5
exercises/tournament/README.md Visa fil

5
 Based on an input file containing which team played against which and what the
5
 Based on an input file containing which team played against which and what the
6
 outcome was, create a file with a table like this:
6
 outcome was, create a file with a table like this:
7
 
7
 
8
-```
8
+```text
9
 Team                           | MP |  W |  D |  L |  P
9
 Team                           | MP |  W |  D |  L |  P
10
 Devastating Donkeys            |  3 |  2 |  1 |  0 |  7
10
 Devastating Donkeys            |  3 |  2 |  1 |  0 |  7
11
 Allegoric Alaskans             |  3 |  2 |  0 |  1 |  6
11
 Allegoric Alaskans             |  3 |  2 |  0 |  1 |  6
31
 
31
 
32
 Your tallying program will receive input that looks like:
32
 Your tallying program will receive input that looks like:
33
 
33
 
34
-```
34
+```text
35
 Allegoric Alaskans;Blithering Badgers;win
35
 Allegoric Alaskans;Blithering Badgers;win
36
 Devastating Donkeys;Courageous Californians;draw
36
 Devastating Donkeys;Courageous Californians;draw
37
 Devastating Donkeys;Allegoric Alaskans;win
37
 Devastating Donkeys;Allegoric Alaskans;win
42
 
42
 
43
 The result of the match refers to the first team listed. So this line
43
 The result of the match refers to the first team listed. So this line
44
 
44
 
45
-```
45
+```text
46
 Allegoric Alaskans;Blithering Badgers;win
46
 Allegoric Alaskans;Blithering Badgers;win
47
 ```
47
 ```
48
 
48
 
50
 
50
 
51
 This line:
51
 This line:
52
 
52
 
53
-```
53
+```text
54
 Courageous Californians;Blithering Badgers;loss
54
 Courageous Californians;Blithering Badgers;loss
55
 ```
55
 ```
56
 
56
 
58
 
58
 
59
 And this line:
59
 And this line:
60
 
60
 
61
-```
61
+```text
62
 Devastating Donkeys;Courageous Californians;draw
62
 Devastating Donkeys;Courageous Californians;draw
63
 ```
63
 ```
64
 
64
 
74
 For more detailed info about the Java track see the [help page](http://exercism.io/languages/java).
74
 For more detailed info about the Java track see the [help page](http://exercism.io/languages/java).
75
 
75
 
76
 
76
 
77
+
77
 ## Submitting Incomplete Solutions
78
 ## Submitting Incomplete Solutions
78
 It's possible to submit an incomplete solution so you can see how others have completed the exercise.
79
 It's possible to submit an incomplete solution so you can see how others have completed the exercise.

+ 7
- 7
exercises/transpose/README.md Visa fil

4
 
4
 
5
 Roughly explained, the transpose of a matrix:
5
 Roughly explained, the transpose of a matrix:
6
 
6
 
7
-```
7
+```text
8
 ABC
8
 ABC
9
 DEF
9
 DEF
10
 ```
10
 ```
11
 
11
 
12
 is given by:
12
 is given by:
13
 
13
 
14
-```
14
+```text
15
 AD
15
 AD
16
 BE
16
 BE
17
 CF
17
 CF
26
 
26
 
27
 Therefore, transposing this matrix:
27
 Therefore, transposing this matrix:
28
 
28
 
29
-```
29
+```text
30
 ABC
30
 ABC
31
 DE
31
 DE
32
 ```
32
 ```
33
 
33
 
34
 results in:
34
 results in:
35
 
35
 
36
-```
36
+```text
37
 AD
37
 AD
38
 BE
38
 BE
39
 C
39
 C
41
 
41
 
42
 And transposing:
42
 And transposing:
43
 
43
 
44
-```
44
+```text
45
 AB
45
 AB
46
 DEF
46
 DEF
47
 ```
47
 ```
48
 
48
 
49
 results in:
49
 results in:
50
 
50
 
51
-```
51
+```text
52
 AD
52
 AD
53
 BE
53
 BE
54
  F
54
  F
55
 ```
55
 ```
56
 
56
 
57
 In general, all characters from the input should also be present in the transposed output.
57
 In general, all characters from the input should also be present in the transposed output.
58
-That means that if a column in the input text contains only spaces on its bottom-most row(s), 
58
+That means that if a column in the input text contains only spaces on its bottom-most row(s),
59
 the corresponding output row should contain the spaces in its right-most column(s).
59
 the corresponding output row should contain the spaces in its right-most column(s).
60
 
60
 
61
 
61
 

+ 9
- 6
exercises/triangle/README.md Visa fil

2
 
2
 
3
 Determine if a triangle is equilateral, isosceles, or scalene.
3
 Determine if a triangle is equilateral, isosceles, or scalene.
4
 
4
 
5
-An _equilateral_ triangle has all three sides the same length.<br/>
5
+An _equilateral_ triangle has all three sides the same length.
6
+
6
 An _isosceles_ triangle has at least two sides the same length. (It is sometimes
7
 An _isosceles_ triangle has at least two sides the same length. (It is sometimes
7
 specified as having exactly two sides the same length, but for the purposes of
8
 specified as having exactly two sides the same length, but for the purposes of
8
-this exercise we'll say at least two.)<br/>
9
+this exercise we'll say at least two.)
10
+
9
 A _scalene_ triangle has all sides of different lengths.
11
 A _scalene_ triangle has all sides of different lengths.
10
 
12
 
11
 ## Note
13
 ## Note
12
 
14
 
13
-For a shape to be a triangle at all, all sides have to be of length > 0, and 
14
-the sum of the lengths of any two sides must be greater than or equal to the 
15
+For a shape to be a triangle at all, all sides have to be of length > 0, and
16
+the sum of the lengths of any two sides must be greater than or equal to the
15
 length of the third side. See [Triangle Inequality](https://en.wikipedia.org/wiki/Triangle_inequality).
17
 length of the third side. See [Triangle Inequality](https://en.wikipedia.org/wiki/Triangle_inequality).
16
 
18
 
17
 ## Dig Deeper
19
 ## Dig Deeper
18
 
20
 
19
-The case where the sum of the lengths of two sides _equals_ that of the 
20
-third is known as a _degenerate_ triangle - it has zero area and looks like 
21
+The case where the sum of the lengths of two sides _equals_ that of the
22
+third is known as a _degenerate_ triangle - it has zero area and looks like
21
 a single line. Feel free to add your own code/tests to check for degenerate triangles.
23
 a single line. Feel free to add your own code/tests to check for degenerate triangles.
22
 
24
 
25
+
23
 To run the tests:
26
 To run the tests:
24
 
27
 
25
 ```sh
28
 ```sh

+ 1
- 1
exercises/trinary/README.md Visa fil

11
 The last place in a trinary number is the 1's place. The second to last
11
 The last place in a trinary number is the 1's place. The second to last
12
 is the 3's place, the third to last is the 9's place, etc.
12
 is the 3's place, the third to last is the 9's place, etc.
13
 
13
 
14
-```bash
14
+```shell
15
 # "102012"
15
 # "102012"
16
     1       0       2       0       1       2    # the number
16
     1       0       2       0       1       2    # the number
17
 1*3^5 + 0*3^4 + 2*3^3 + 0*3^2 + 1*3^1 + 2*3^0    # the value
17
 1*3^5 + 0*3^4 + 2*3^3 + 0*3^2 + 1*3^1 + 2*3^0    # the value

+ 1
- 1
exercises/twelve-days/README.md Visa fil

2
 
2
 
3
 Output the lyrics to 'The Twelve Days of Christmas'.
3
 Output the lyrics to 'The Twelve Days of Christmas'.
4
 
4
 
5
-```
5
+```text
6
 On the first day of Christmas my true love gave to me, a Partridge in a Pear Tree.
6
 On the first day of Christmas my true love gave to me, a Partridge in a Pear Tree.
7
 
7
 
8
 On the second day of Christmas my true love gave to me, two Turtle Doves, and a Partridge in a Pear Tree.
8
 On the second day of Christmas my true love gave to me, two Turtle Doves, and a Partridge in a Pear Tree.

+ 1
- 2
exercises/two-fer/README.md Visa fil

2
 
2
 
3
 `Two-fer` or `2-fer` is short for two for one. One for you and one for me.
3
 `Two-fer` or `2-fer` is short for two for one. One for you and one for me.
4
 
4
 
5
-```
5
+```text
6
 "One for X, one for me."
6
 "One for X, one for me."
7
 ```
7
 ```
8
 
8
 
11
 If the given name is "Alice", the result should be "One for Alice, one for me."
11
 If the given name is "Alice", the result should be "One for Alice, one for me."
12
 If no name is given, the result should be "One for you, one for me."
12
 If no name is given, the result should be "One for you, one for me."
13
 
13
 
14
-
15
 ## Test-Driven Development
14
 ## Test-Driven Development
16
 
15
 
17
 As programmers mature, they eventually want to test their code.
16
 As programmers mature, they eventually want to test their code.

+ 1
- 2
exercises/word-count/README.md Visa fil

4
 
4
 
5
 For example for the input `"olly olly in come free"`
5
 For example for the input `"olly olly in come free"`
6
 
6
 
7
-```plain
7
+```text
8
 olly: 2
8
 olly: 2
9
 in: 1
9
 in: 1
10
 come: 1
10
 come: 1
12
 ```
12
 ```
13
 
13
 
14
 
14
 
15
-
16
 To run the tests:
15
 To run the tests:
17
 
16
 
18
 ```sh
17
 ```sh

+ 1
- 1
exercises/word-search/README.md Visa fil

5
 
5
 
6
 For example:
6
 For example:
7
 
7
 
8
-```
8
+```text
9
 jefblpepre
9
 jefblpepre
10
 camdcimgtc
10
 camdcimgtc
11
 oivokprjsm
11
 oivokprjsm

+ 0
- 5
exercises/wordy/README.md Visa fil

2
 
2
 
3
 Parse and evaluate simple math word problems returning the answer as an integer.
3
 Parse and evaluate simple math word problems returning the answer as an integer.
4
 
4
 
5
-
6
 ## Iteration 1 — Addition
5
 ## Iteration 1 — Addition
7
 
6
 
8
 Add two numbers together.
7
 Add two numbers together.
13
 
12
 
14
 Handle large numbers and negative numbers.
13
 Handle large numbers and negative numbers.
15
 
14
 
16
-
17
 ## Iteration 2 — Subtraction, Multiplication and Division
15
 ## Iteration 2 — Subtraction, Multiplication and Division
18
 
16
 
19
 Now, perform the other three operations.
17
 Now, perform the other three operations.
30
 
28
 
31
 5
29
 5
32
 
30
 
33
-
34
 ## Iteration 3 — Multiple Operations
31
 ## Iteration 3 — Multiple Operations
35
 
32
 
36
 Handle a set of operations, in sequence.
33
 Handle a set of operations, in sequence.
46
 
43
 
47
 15  (i.e. not 9)
44
 15  (i.e. not 9)
48
 
45
 
49
-
50
 ## Bonus — Exponentials
46
 ## Bonus — Exponentials
51
 
47
 
52
 If you'd like, handle exponentials.
48
 If you'd like, handle exponentials.
56
 32
52
 32
57
 
53
 
58
 
54
 
59
-
60
 To run the tests:
55
 To run the tests:
61
 
56
 
62
 ```sh
57
 ```sh