diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/9-billion-names-of-god-the-integer.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/9-billion-names-of-god-the-integer.english.md index dd6ba77260..b8093d3783 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/9-billion-names-of-god-the-integer.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/9-billion-names-of-god-the-integer.english.md @@ -26,7 +26,7 @@ This can be visualized in the following form: 1 3 3 2 1 1 Where row $n$ corresponds to integer $n$, and each column $C$ in row $m$ from left to right corresponds to the number of names beginning with $C$. -Optionally note that the sum of the $n$-th row $P(n)$ is the integer partition function. +Optionally note that the sum of the $n$-th row $P(n)$ is the integer partition function. ## Instructions diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/accumulator-factory.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/accumulator-factory.english.md index e6d9ffd70b..b731f5308f 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/accumulator-factory.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/accumulator-factory.english.md @@ -6,7 +6,7 @@ challengeType: 5 ## Description
-A problem posed by Paul Graham is that of creating a function that takes a single (numeric) argument and which returns another function that is an accumulator. The returned accumulator function in turn also takes a single numeric argument, and returns the sum of all the numeric values passed in so far to that accumulator (including the initial value passed when the accumulator was created). +A problem posed by Paul Graham is that of creating a function that takes a single (numeric) argument and which returns another function that is an accumulator. The returned accumulator function in turn also takes a single numeric argument, and returns the sum of all the numeric values passed in so far to that accumulator (including the initial value passed when the accumulator was created).
## Instructions diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/align-columns.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/align-columns.english.md index 0fdcc89528..a78785562f 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/align-columns.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/align-columns.english.md @@ -24,15 +24,15 @@ Further,$allow$for$each$word$in$a$column$to$be$either$left$ justified,$right$justified or$center$justified$within$its$column. -Note that: -
    +Note that: +
+ ## Tests diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/amicable-pairs.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/amicable-pairs.english.md index 3ebda95569..b54b1d4e58 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/amicable-pairs.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/amicable-pairs.english.md @@ -6,9 +6,9 @@ challengeType: 5 ## Description
-Two integers $N$ and $M$ are said to be amicable pairs if $N \neq M$ and the sum of the proper divisors of $N$ ($\mathrm{sum}(\mathrm{propDivs}(N))$) $= M$ as well as $\mathrm{sum}(\mathrm{propDivs}(M)) = N$. -Example: -1184 and 1210 are an amicable pair, with proper divisors: +Two integers $N$ and $M$ are said to be amicable pairs if $N \neq M$ and the sum of the proper divisors of $N$ ($\mathrm{sum}(\mathrm{propDivs}(N))$) $= M$ as well as $\mathrm{sum}(\mathrm{propDivs}(M)) = N$. +Example: +1184 and 1210 are an amicable pair, with proper divisors: -Note: Assume words are non-empty strings of uppercase characters for this task. +Note: Assume words are non-empty strings of uppercase characters for this task.
## Tests diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/count-the-coins.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/count-the-coins.english.md index 1a7ab2f067..e7d474112b 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/count-the-coins.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/count-the-coins.english.md @@ -27,10 +27,6 @@ There are four types of common coins in an algorithm from MIT Press. - ## Tests diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/cramers-rule.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/cramers-rule.english.md index 7aec360d05..f7d159def0 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/cramers-rule.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/cramers-rule.english.md @@ -6,7 +6,7 @@ challengeType: 5 ## Description
-In linear algebra, Cramer's rule is an explicit formula for the solution of a system of linear equations with as many equations as unknowns, valid whenever the system has a unique solution. It expresses the solution in terms of the determinants of the (square) coefficient matrix and of matrices obtained from it by replacing one column by the vector of right hand sides of the equations. +In linear algebra, Cramer's rule is an explicit formula for the solution of a system of linear equations with as many equations as unknowns, valid whenever the system has a unique solution. It expresses the solution in terms of the determinants of the (square) coefficient matrix and of matrices obtained from it by replacing one column by the vector of right hand sides of the equations. Given $\left\{\begin{matrix}a_1x + b_1y + c_1z&= {\color{red}d_1}\\a_2x + b_2y + c_2z&= {\color{red}d_2}\\a_3x + b_3y + c_3z&= {\color{red}d_3}\end{matrix}\right.$ diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/cumulative-standard-deviation.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/cumulative-standard-deviation.english.md similarity index 100% rename from curriculum/challenges/english/08-coding-interview-prep/rosetta-code/cumulative-standard-deviation.md rename to curriculum/challenges/english/08-coding-interview-prep/rosetta-code/cumulative-standard-deviation.english.md diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/cusip.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/cusip.english.md similarity index 100% rename from curriculum/challenges/english/08-coding-interview-prep/rosetta-code/cusip.md rename to curriculum/challenges/english/08-coding-interview-prep/rosetta-code/cusip.english.md diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/cut-a-rectangle.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/cut-a-rectangle.english.md similarity index 96% rename from curriculum/challenges/english/08-coding-interview-prep/rosetta-code/cut-a-rectangle.md rename to curriculum/challenges/english/08-coding-interview-prep/rosetta-code/cut-a-rectangle.english.md index 978362613e..8f7a66b463 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/cut-a-rectangle.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/cut-a-rectangle.english.md @@ -8,7 +8,7 @@ challengeType: 5
A given rectangle is made from m × n squares. If m and n are not both odd, then it is possible to cut a path through the rectangle along the square edges such that the rectangle splits into two connected pieces with the same shape (after rotating one of the pieces by 180°). All such paths for 2 × 2 and 4 × 3 rectangles are shown below.
- FreeCell is the solitaire card game that Paul Alfille introduced to the PLATO system in 1978. Jim Horne, at Microsoft, changed the name to FreeCell and reimplemented the game for DOS, then Windows. This version introduced 32000 numbered deals. (The FreeCell FAQ tells this history.) -As the game became popular, Jim Horne disclosed the algorithm, and other implementations of FreeCell began to reproduce the Microsoft deals. These deals are numbered from 1 to 32000. Newer versions from Microsoft have 1 million deals, numbered from 1 to 1000000; some implementations allow numbers outside that range. -The algorithm uses this linear congruential generator from Microsoft C: +FreeCell is the solitaire card game that Paul Alfille introduced to the PLATO system in 1978. Jim Horne, at Microsoft, changed the name to FreeCell and reimplemented the game for DOS, then Windows. This version introduced 32000 numbered deals. +As the game became popular, Jim Horne disclosed the algorithm, and other implementations of FreeCell began to reproduce the Microsoft deals. These deals are numbered from 1 to 32000. Newer versions from Microsoft have 1 million deals, numbered from 1 to 1000000; some implementations allow numbers outside that range. +The algorithm uses this linear congruential generator from Microsoft C:
  • $state_{n + 1} \equiv 214013 \times state_n + 2531011 \pmod{2^{31}}$
  • $rand_n = state_n \div 2^{16}$
  • @@ -17,7 +17,7 @@ The algorithm uses this array of 52 cards: Ace of Clubs, Ace of Diamonds, Ace of Hearts, Ace of Spades, 2 of Clubs, 2 of Diamonds, and so on through the ranks: Ace, 2, 3, 4, 5, 6, 7, 8, 9, 10, Jack, Queen, King. The array indexes are 0 to 51, with Ace of Clubs at 0, and King of Spades at 51. +
  • Create an array of 52 cards: Ace of Clubs, Ace of Diamonds, Ace of Hearts, Ace of Spades, 2 of Clubs, 2 of Diamonds, and so on through the ranks: Ace, 2, 3, 4, 5, 6, 7, 8, 9, 10, Jack, Queen, King. The array indexes are 0 to 51, with Ace of Clubs at 0, and King of Spades at 51.
  • Until the array is empty:
  • Choose a random card at index ≡ next random number (mod array length).
    • @@ -37,31 +37,37 @@ The algorithm follows: 41 42 43 44 45 46 47 48 49 50 51 52 Game #1 -
      [
      -['JD', '2D', '9H', 'JC', '5D', '7H', '7C', '5H'],
      -['KD', 'KC', '9S', '5S', 'AD', 'QC', 'KH', '3H'],
      -['2S', 'KS', '9D', 'QD', 'JS', 'AS', 'AH', '3C'],
      -['4C', '5C', 'TS', 'QH', '4H', 'AC', '4D', '7S'],
      -['3S', 'TD', '4S', 'TH', '8H', '2C', 'JH', '7D'],
      -['6D', '8S', '8D', 'QS', '6C', '3D', '8C', 'TC'],
      -['6S', '9C', '2H', '6H']
      -]
      + +```js +[ + ['JD', '2D', '9H', 'JC', '5D', '7H', '7C', '5H'], + ['KD', 'KC', '9S', '5S', 'AD', 'QC', 'KH', '3H'], + ['2S', 'KS', '9D', 'QD', 'JS', 'AS', 'AH', '3C'], + ['4C', '5C', 'TS', 'QH', '4H', 'AC', '4D', '7S'], + ['3S', 'TD', '4S', 'TH', '8H', '2C', 'JH', '7D'], + ['6D', '8S', '8D', 'QS', '6C', '3D', '8C', 'TC'], + ['6S', '9C', '2H', '6H'] +] +``` Game #617 -
      [
      -['7D', 'AD', '5C', '3S', '5S', '8C', '2D', 'AH'],
      -['TD', '7S', 'QD', 'AC', '6D', '8H', 'AS', 'KH'],
      -['TH', 'QC', '3H', '9D', '6S', '8D', '3D', 'TC'],
      -['KD', '5H', '9S', '3C', '8S', '7H', '4D', 'JS'],
      -['4C', 'QS', '9C', '9H', '7C', '6H', '2C', '2S'],
      -['4S', 'TS', '2H', '5D', 'JC', '6C', 'JH', 'QH'],
      -['JD', 'KS', 'KC', '4H']
      -]
      + +```js +[ + ['7D', 'AD', '5C', '3S', '5S', '8C', '2D', 'AH'], + ['TD', '7S', 'QD', 'AC', '6D', '8H', 'AS', 'KH'], + ['TH', 'QC', '3H', '9D', '6S', '8D', '3D', 'TC'], + ['KD', '5H', '9S', '3C', '8S', '7H', '4D', 'JS'], + ['4C', 'QS', '9C', '9H', '7C', '6H', '2C', '2S'], + ['4S', 'TS', '2H', '5D', 'JC', '6C', 'JH', 'QH'], + ['JD', 'KS', 'KC', '4H'] +] +```
## Instructions
Write a function to take a deal number and deal cards in the same order as this algorithm. The function must return a two dimensional array representing the FreeCell board. -Deals can also be checked against FreeCell solutions to 1000000 games. (Summon a video solution, and it displays the initial deal.) +Deals can also be checked against FreeCell solutions to 1000000 games. (Summon a video solution, and it displays the initial deal.)
## Tests diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/department-numbers.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/department-numbers.english.md index 488d5c0ed8..f245d4e29d 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/department-numbers.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/department-numbers.english.md @@ -19,14 +19,15 @@ The Chief of the Police doesn't like odd numbers and wants to have an even numbe ## Instructions
-Write a program which outputs all valid combinations: -
-[2, 3, 7] [2, 4, 6] [2, 6, 4]
-[2, 7, 3] [4, 1, 7] [4, 2, 6]
-[4, 3, 5] [4, 5, 3] [4, 6, 2]
-[4, 7, 1] [6, 1, 5] [6, 2, 4]
+Write a program which outputs all valid combinations as an array. + +```js +[2, 3, 7] [2, 4, 6] [2, 6, 4] +[2, 7, 3] [4, 1, 7] [4, 2, 6] +[4, 3, 5] [4, 5, 3] [4, 6, 2] +[4, 7, 1] [6, 1, 5] [6, 2, 4] [6, 4, 2] [6, 5, 1] -
+```
## Tests diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/discordian-date.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/discordian-date.english.md index b39fae4790..a9fe6d260c 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/discordian-date.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/discordian-date.english.md @@ -6,7 +6,7 @@ challengeType: 5 ## Description
-Convert a given date from the Gregorian calendar to the Discordian calendar. +Convert a given date from the Gregorian calendar to the Discordian calendar.
## Instructions diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/dot-product.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/dot-product.english.md similarity index 100% rename from curriculum/challenges/english/08-coding-interview-prep/rosetta-code/dot-product.md rename to curriculum/challenges/english/08-coding-interview-prep/rosetta-code/dot-product.english.md diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/execute-brain.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/execute-brain.english.md index 4093a362a4..ba61a7402d 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/execute-brain.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/execute-brain.english.md @@ -7,7 +7,7 @@ challengeType: 5 ## Description
Write a function to implement a Brain**** interpreter. The function will take a string as a parameter and should return a string as the output. More details are given below: -RCBF is a set of Brainf*** compilers and interpreters written for Rosetta Code in a variety of languages. +RCBF is a set of Brainf*** compilers and interpreters written for Rosetta Code in a variety of languages. Below are links to each of the versions of RCBF. An implementation need only properly implement the following instructions: diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/general-fizzbuzz.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/general-fizzbuzz.english.md index bdd2cbb149..5a6eb3bbf1 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/general-fizzbuzz.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/general-fizzbuzz.english.md @@ -6,7 +6,7 @@ challengeType: 5 ## Description
-Write a generalized version of FizzBuzz that works for any list of factors, along with their words. +Write a generalized version of FizzBuzz that works for any list of factors, along with their words. This is basically a "fizzbuzz" implementation where the rules of the game are supplied to the user. Create a function to implement this. The function should take two parameters. The first will be an array with the FizzBuzz rules. For example: [ [3, "Fizz"] , [5, "Buzz"] ]. This indcates that Fizz should be printed if the number is a multiple of 3 and Buzz if it is a multiple of 5. If it is a multiple of both then the strings should be concatenated in the order specified in the array. In this case, FizzBuzz if the number is a multiple of 3 and 5. diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/harshad-or-niven-series.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/harshad-or-niven-series.english.md index f1ba5f50b6..0b1c32a86d 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/harshad-or-niven-series.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/harshad-or-niven-series.english.md @@ -6,8 +6,8 @@ challengeType: 5 ## Description
-The Harshad or Niven numbers are positive integers ≥ 1 that are divisible by the sum of their digits. -For example, 42 is a Harshad number as 42 is divisible by (4 + 2) without remainder. +The Harshad or Niven numbers are positive integers ≥ 1 that are divisible by the sum of their digits. +For example, 42 is a Harshad number as 42 is divisible by (4 + 2) without remainder. Assume that the series is defined as the numbers in increasing order.
diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/hash-join.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/hash-join.english.md index 5c227461b2..989b01105a 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/hash-join.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/hash-join.english.md @@ -6,7 +6,7 @@ challengeType: 5 ## Description
-An inner join is an operation that combines two data tables into one table, based on matching column values. The simplest way of implementing this operation is the nested loop join algorithm, but a more scalable alternative is the hash join algorithm. +An inner join is an operation that combines two data tables into one table, based on matching column values. The simplest way of implementing this operation is the nested loop join algorithm, but a more scalable alternative is the hash join algorithm. The "hash join" algorithm consists of two steps:
  1. Hash phase: Create a multimap from one of the two tables, mapping from each join column value to all the rows that contain it.
  2. diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/heronian-triangles.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/heronian-triangles.english.md index c57b517021..7b8bd6e2b8 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/heronian-triangles.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/heronian-triangles.english.md @@ -10,7 +10,7 @@ challengeType: 5 $A = \sqrt{s(s-a)(s-b)(s-c)},$ where s is half the perimeter of the triangle; that is, $s=\frac{a+b+c}{2}.$ -Heronian triangles are triangles whose sides and area are all integers. +Heronian triangles are triangles whose sides and area are all integers. An example is the triangle with sides 3, 4, 5 whose area is 6 (and whose perimeter is 12). Note that any triangle whose sides are all an integer multiple of 3, 4, 5; such as 6, 8, 10, will also be a Heronian triangle. Define a Primitive Heronian triangle as a Heronian triangle where the greatest common divisor diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/hofstadter-figure-figure-sequences.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/hofstadter-figure-figure-sequences.english.md index e4a9154fe5..d65cce5621 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/hofstadter-figure-figure-sequences.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/hofstadter-figure-figure-sequences.english.md @@ -24,9 +24,6 @@ No maximum value for n should be assumed.
  3. Sloane's A005228 and A030124.
  4. -
  5. - Wolfram MathWorld -
  6. Wikipedia: Hofstadter Figure-Figure sequences.
  7. diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/k-d-tree.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/k-d-tree.english.md similarity index 100% rename from curriculum/challenges/english/08-coding-interview-prep/rosetta-code/k-d-tree.md rename to curriculum/challenges/english/08-coding-interview-prep/rosetta-code/k-d-tree.english.md diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/kaprekar-numbers.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/kaprekar-numbers.english.md similarity index 84% rename from curriculum/challenges/english/08-coding-interview-prep/rosetta-code/kaprekar-numbers.md rename to curriculum/challenges/english/08-coding-interview-prep/rosetta-code/kaprekar-numbers.english.md index f26b77ba24..faadadd037 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/kaprekar-numbers.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/kaprekar-numbers.english.md @@ -8,14 +8,14 @@ challengeType: 5
    A positive integer is a Kaprekar number if:
      -
    • It is 1, or,
    • -
    • The decimal representation of its square may be split once into two parts consisting of positive integers which sum to the original number.
    • +
    • It is 1, or,
    • +
    • The decimal representation of its square may be split once into two parts consisting of positive integers which sum to the original number.
    Note that a split resulting in a part consisting purely of 0s is not valid, as 0 is not considered positive.Example Kaprekar numbers:
      -
    • 2223 is a Kaprekar number, as 2223 * 2223 = 4941729, 4941729 may be split to 494 and 1729, and 494 + 1729 = 2223
    • -
    • The series of Kaprekar numbers is known as A006886, and begins as 1, 9, 45, 55, ...
    • +
    • 2223 is a Kaprekar number, as 2223 * 2223 = 4941729, 4941729 may be split to 494 and 1729, and 494 + 1729 = 2223
    • +
    • The series of Kaprekar numbers is known as A006886, and begins as 1, 9, 45, 55, ...
    diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/knight's-tour.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/knight's-tour.english.md similarity index 100% rename from curriculum/challenges/english/08-coding-interview-prep/rosetta-code/knight's-tour.md rename to curriculum/challenges/english/08-coding-interview-prep/rosetta-code/knight's-tour.english.md diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/largest-int-from-concatenated-ints.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/largest-int-from-concatenated-ints.english.md similarity index 100% rename from curriculum/challenges/english/08-coding-interview-prep/rosetta-code/largest-int-from-concatenated-ints.md rename to curriculum/challenges/english/08-coding-interview-prep/rosetta-code/largest-int-from-concatenated-ints.english.md diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/last-friday-of-each-month.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/last-friday-of-each-month.english.md similarity index 100% rename from curriculum/challenges/english/08-coding-interview-prep/rosetta-code/last-friday-of-each-month.md rename to curriculum/challenges/english/08-coding-interview-prep/rosetta-code/last-friday-of-each-month.english.md diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/leap-year.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/leap-year.english.md similarity index 100% rename from curriculum/challenges/english/08-coding-interview-prep/rosetta-code/leap-year.md rename to curriculum/challenges/english/08-coding-interview-prep/rosetta-code/leap-year.english.md diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/least-common-multiple.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/least-common-multiple.english.md similarity index 95% rename from curriculum/challenges/english/08-coding-interview-prep/rosetta-code/least-common-multiple.md rename to curriculum/challenges/english/08-coding-interview-prep/rosetta-code/least-common-multiple.english.md index ad04931f14..35094acce3 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/least-common-multiple.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/least-common-multiple.english.md @@ -8,7 +8,7 @@ challengeType: 5
    The least common multiple of 12 and 18 is 36, because 12 is a factor (12 × 3 = 36), and 18 is a factor (18 × 2 = 36), and there is no positive integer less than 36 that has both factors. As a special case, if either m or n is zero, then the least common multiple is zero. One way to calculate the least common multiple is to iterate all the multiples of m, until you find one that is also a multiple of n. -If you already have gcd for greatest common divisor, then this formula calculates lcm. +If you already have gcd for greatest common divisor, then this formula calculates lcm. \( \operatorname{lcm}(m, n) = \frac{|m \times n|}{\operatorname{gcd}(m, n)} \)
    diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/left-factorials.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/left-factorials.english.md similarity index 98% rename from curriculum/challenges/english/08-coding-interview-prep/rosetta-code/left-factorials.md rename to curriculum/challenges/english/08-coding-interview-prep/rosetta-code/left-factorials.english.md index 1f0e915f71..b80a7b3cf9 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/left-factorials.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/left-factorials.english.md @@ -8,9 +8,9 @@ challengeType: 5
    Left factorials, $ !n $, may refer to either subfactorials or to factorial sums. The same notation can be confusingly seen used for the two different definitions. Sometimes, subfactorials (also known as derangements) may use any of the notations:
      -
    • $!n`$
    • -
    • $!n$
    • -
    • $n¡$
    • +
    • $!n`$
    • +
    • $!n$
    • +
    • $n¡$
    (It may not be visually obvious, but the last example uses an upside-down exclamation mark.) This task will be using this formula for left factorial: $ !n = \sum_{k=0}^{n-1} k! $ diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/s-expressions.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/s-expressions.english.md index 3cb96e68c6..a5b7cebda0 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/s-expressions.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/s-expressions.english.md @@ -15,7 +15,7 @@ Write a simple reader/parser for S-Expressions that handles quoted and unquoted The function should read a single but nested S-Expression from a string and return it as a (nested) array. Newlines and other whitespace may be ignored unless contained within a quoted string. "()" inside quoted strings are not interpreted, but treated as part of the string. -Handling escaped quotes inside a string is optional; thus "(foo"bar)" maybe treated as a string "foo"bar", or as an error. +Handling escaped quotes inside a string is optional; thus "(foo"bar)" may be treated as a string "foo"bar", or as an error. For this, the reader need not recognize "\" for escaping, but should, in addition, recognize numbers if the language has appropriate datatypes. Note that with the exception of "()"" ("\" if escaping is supported) and whitespace there are no special characters. Anything else is allowed without quotes. The reader should be able to read the following input diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sort-an-array-of-composite-structures.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sort-an-array-of-composite-structures.english.md similarity index 100% rename from curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sort-an-array-of-composite-structures.md rename to curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sort-an-array-of-composite-structures.english.md diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sort-disjoint-sublist.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sort-disjoint-sublist.english.md similarity index 100% rename from curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sort-disjoint-sublist.md rename to curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sort-disjoint-sublist.english.md diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sort-stability.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sort-stability.english.md similarity index 100% rename from curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sort-stability.md rename to curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sort-stability.english.md diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sort-using-a-custom-comparator.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sort-using-a-custom-comparator.english.md similarity index 100% rename from curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sort-using-a-custom-comparator.md rename to curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sort-using-a-custom-comparator.english.md diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sorting-algorithms-bead-sort.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sorting-algorithms-bead-sort.english.md similarity index 100% rename from curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sorting-algorithms-bead-sort.md rename to curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sorting-algorithms-bead-sort.english.md diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sorting-algorithms-bogosort.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sorting-algorithms-bogosort.english.md similarity index 100% rename from curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sorting-algorithms-bogosort.md rename to curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sorting-algorithms-bogosort.english.md diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sorting-algorithms-cocktail-sort.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sorting-algorithms-cocktail-sort.english.md similarity index 100% rename from curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sorting-algorithms-cocktail-sort.md rename to curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sorting-algorithms-cocktail-sort.english.md diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sorting-algorithms-comb-sort.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sorting-algorithms-comb-sort.english.md similarity index 95% rename from curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sorting-algorithms-comb-sort.md rename to curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sorting-algorithms-comb-sort.english.md index a532f5fd22..2465650cde 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sorting-algorithms-comb-sort.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sorting-algorithms-comb-sort.english.md @@ -32,9 +32,9 @@ Pseudocode: gap := 1 end if i := 0 - swaps := 0 //see Bubble Sort for an explanation + swaps := 0 //see Bubble Sort for an explanation //a single "comb" over the input list - loop until i + gap >= input.size //see Shell sort for similar idea + loop until i + gap >= input.size //see Shell sort for similar idea if input[i] > input[i+gap] swap(input[i], input[i+gap]) swaps := 1 // Flag a swap has occurred, so the diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sorting-algorithms-gnome-sort.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sorting-algorithms-gnome-sort.english.md similarity index 100% rename from curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sorting-algorithms-gnome-sort.md rename to curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sorting-algorithms-gnome-sort.english.md diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sorting-algorithms-pancake-sort.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sorting-algorithms-pancake-sort.english.md similarity index 100% rename from curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sorting-algorithms-pancake-sort.md rename to curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sorting-algorithms-pancake-sort.english.md diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sorting-algorithms-permutation-sort.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sorting-algorithms-permutation-sort.english.md similarity index 100% rename from curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sorting-algorithms-permutation-sort.md rename to curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sorting-algorithms-permutation-sort.english.md diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sorting-algorithms-shell-sort.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sorting-algorithms-shell-sort.english.md similarity index 100% rename from curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sorting-algorithms-shell-sort.md rename to curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sorting-algorithms-shell-sort.english.md diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sorting-algorithms-stooge-sort.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sorting-algorithms-stooge-sort.english.md similarity index 100% rename from curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sorting-algorithms-stooge-sort.md rename to curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sorting-algorithms-stooge-sort.english.md diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sorting-algorithms-strand-sort.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sorting-algorithms-strand-sort.english.md similarity index 100% rename from curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sorting-algorithms-strand-sort.md rename to curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sorting-algorithms-strand-sort.english.md diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/soundex.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/soundex.english.md similarity index 100% rename from curriculum/challenges/english/08-coding-interview-prep/rosetta-code/soundex.md rename to curriculum/challenges/english/08-coding-interview-prep/rosetta-code/soundex.english.md diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/spiral-matrix.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/spiral-matrix.english.md similarity index 100% rename from curriculum/challenges/english/08-coding-interview-prep/rosetta-code/spiral-matrix.md rename to curriculum/challenges/english/08-coding-interview-prep/rosetta-code/spiral-matrix.english.md diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/split-a-character-string-based-on-change-of-character.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/split-a-character-string-based-on-change-of-character.english.md similarity index 100% rename from curriculum/challenges/english/08-coding-interview-prep/rosetta-code/split-a-character-string-based-on-change-of-character.md rename to curriculum/challenges/english/08-coding-interview-prep/rosetta-code/split-a-character-string-based-on-change-of-character.english.md diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/state-name-puzzle.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/state-name-puzzle.english.md similarity index 91% rename from curriculum/challenges/english/08-coding-interview-prep/rosetta-code/state-name-puzzle.md rename to curriculum/challenges/english/08-coding-interview-prep/rosetta-code/state-name-puzzle.english.md index 3aeb13f00c..793e5d6f43 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/state-name-puzzle.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/state-name-puzzle.english.md @@ -6,10 +6,10 @@ challengeType: 5 ## Description
    -This task is inspired by Mark Nelson's DDJ Column "Wordplay" and one of the weekly puzzle challenges from Will Shortz on NPR Weekend Edition [1] and originally attributed to David Edelheit. +This task is inspired by Mark Nelson's DDJ Column "Wordplay" and one of the weekly puzzle challenges from Will Shortz on NPR Weekend Edition [1] and originally attributed to David Edelheit. The challenge was to take the names of two U.S. States, mix them all together, then rearrange the letters to form the names of two different U.S. States (so that all four state names differ from one another). What states are these? -The problem was reissued on the Unicon Discussion Web which includes several solutions with analysis. Several techniques may be helpful and you may wish to refer to Gödel numbering, equivalence relations, and equivalence classes. The basic merits of these were discussed in the Unicon Discussion Web. +The problem was reissued on the Unicon Discussion Web which includes several solutions with analysis. Several techniques may be helpful and you may wish to refer to Gödel numbering, equivalence relations, and equivalence classes. The basic merits of these were discussed in the Unicon Discussion Web. A second challenge in the form of a set of fictitious new states was also presented.
    diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/stern-brocot-sequence.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/stern-brocot-sequence.english.md similarity index 100% rename from curriculum/challenges/english/08-coding-interview-prep/rosetta-code/stern-brocot-sequence.md rename to curriculum/challenges/english/08-coding-interview-prep/rosetta-code/stern-brocot-sequence.english.md diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/straddling-checkerboard.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/straddling-checkerboard.english.md similarity index 100% rename from curriculum/challenges/english/08-coding-interview-prep/rosetta-code/straddling-checkerboard.md rename to curriculum/challenges/english/08-coding-interview-prep/rosetta-code/straddling-checkerboard.english.md diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/stream-merge.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/stream-merge.english.md similarity index 100% rename from curriculum/challenges/english/08-coding-interview-prep/rosetta-code/stream-merge.md rename to curriculum/challenges/english/08-coding-interview-prep/rosetta-code/stream-merge.english.md diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/strip-control-codes-and-extended-characters-from-a-string.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/strip-control-codes-and-extended-characters-from-a-string.english.md similarity index 100% rename from curriculum/challenges/english/08-coding-interview-prep/rosetta-code/strip-control-codes-and-extended-characters-from-a-string.md rename to curriculum/challenges/english/08-coding-interview-prep/rosetta-code/strip-control-codes-and-extended-characters-from-a-string.english.md diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/subleq.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/subleq.english.md similarity index 100% rename from curriculum/challenges/english/08-coding-interview-prep/rosetta-code/subleq.md rename to curriculum/challenges/english/08-coding-interview-prep/rosetta-code/subleq.english.md diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sudoku.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sudoku.english.md similarity index 100% rename from curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sudoku.md rename to curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sudoku.english.md diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sum-digits-of-an-integer.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sum-digits-of-an-integer.english.md similarity index 100% rename from curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sum-digits-of-an-integer.md rename to curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sum-digits-of-an-integer.english.md diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sum-multiples-of-3-and-5.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sum-multiples-of-3-and-5.english.md similarity index 100% rename from curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sum-multiples-of-3-and-5.md rename to curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sum-multiples-of-3-and-5.english.md diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sum-of-a-series.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sum-of-a-series.english.md similarity index 91% rename from curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sum-of-a-series.md rename to curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sum-of-a-series.english.md index 5cf8182fcf..2602f4d5b5 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sum-of-a-series.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sum-of-a-series.english.md @@ -11,9 +11,9 @@ Informally this value, or its limit when n tends to infinity, is also c For this task, use: $S_n = \sum_{k=1}^n \frac{1}{k^2}$ and compute $S_{1000}$ -This approximates the zeta function for S=2, whose exact value + This approximates the zeta function for S=2, whose exact value $\zeta(2) = {\pi^2\over 6}$ -is the solution of the Basel problem. + is the solution of the Basel problem.
    ## Instructions diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sum-of-squares.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sum-of-squares.english.md similarity index 100% rename from curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sum-of-squares.md rename to curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sum-of-squares.english.md diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sum-to-100.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sum-to-100.english.md similarity index 100% rename from curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sum-to-100.md rename to curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sum-to-100.english.md diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sutherland-hodgman-polygon-clipping.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sutherland-hodgman-polygon-clipping.english.md similarity index 100% rename from curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sutherland-hodgman-polygon-clipping.md rename to curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sutherland-hodgman-polygon-clipping.english.md diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/symmetric-difference.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/symmetric-difference.english.md similarity index 100% rename from curriculum/challenges/english/08-coding-interview-prep/rosetta-code/symmetric-difference.md rename to curriculum/challenges/english/08-coding-interview-prep/rosetta-code/symmetric-difference.english.md diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/taxicab-numbers.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/taxicab-numbers.english.md index 296264576d..c9237b3fea 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/taxicab-numbers.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/taxicab-numbers.english.md @@ -25,8 +25,6 @@ Write a function that returns the lowest n taxicab numbers. For eac See also:
diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/y-combinator.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/y-combinator.english.md index b298713353..9b44171e6b 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/y-combinator.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/y-combinator.english.md @@ -12,7 +12,7 @@ The Y combin ## Instructions
-Define the stateless Y combinator function and use it to compute factorial. The factorial(N) function is already given to you. +Define the stateless Y combinator function and use it to compute factorial. The factorial(N) function is already given to you. See also: