diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/last-letter-first-letter.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/last-letter-first-letter.english.md index f2165912e1..d7fe01dda5 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/last-letter-first-letter.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/last-letter-first-letter.english.md @@ -19,7 +19,7 @@ Child 2: snake ## Instructions
-Write a function that takes an input array of words. The function should return an array of words where the first letter of each word is the same as the last letter of the previous word. The first word in the return array can be anything. Use only the words in the input array, and once a word is used it cannot be repeated. The words in the return array should be selected and sequenced so that that the length of the array is maximized. +Write a function that takes an input array of words. The function should return an array of words where the first letter of each word is the same as the last letter of the previous word. Only use the words in the input array, and once a word is used it cannot be repeated. The words in the return array should be selected and sequenced so that that its length is maximized.
## Tests @@ -51,7 +51,7 @@ tests:
```js -function findLongestChain (items) { +function findLongestChain(items) { // Good luck! } ``` @@ -64,7 +64,7 @@ function findLongestChain (items) {
```js -function findLongestChain (items) { +function findLongestChain(items) { function Ref(index, first_char, last_char) { this.index = index; this.first_char = first_char; diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/letter-frequency.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/letter-frequency.english.md index c4b372f2ab..c48e854ea1 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/letter-frequency.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/letter-frequency.english.md @@ -6,7 +6,7 @@ challengeType: 5 ## Description
-You are given a string and your task is to calculate frequency of each character. +Given a string, calculate the frequency of each character. All characters should be counted. This includes lower and upper case letters, digits, whitespace, special characters, or any other distinct characters.
@@ -48,7 +48,7 @@ tests:
```js -function letterFrequency (txt) { +function letterFrequency(txt) { // Good luck! } ``` @@ -61,7 +61,7 @@ function letterFrequency (txt) {
```js -function letterFrequency (txt) { +function letterFrequency(txt) { var cs = txt.split(''), i = cs.length, dct = {}, diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/levenshtein-distance.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/levenshtein-distance.md index 79d9903352..a6cad75d8f 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/levenshtein-distance.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/levenshtein-distance.md @@ -6,19 +6,21 @@ challengeType: 5 ## Description
-In information theory and computer science, the Levenshtein distance is a metric for measuring the amount of difference between two sequences (i.e. an edit distance). The Levenshtein distance between two strings is defined as the minimum number of edits needed to transform one string into the other, with the allowable edit operations being insertion, deletion, or substitution of a single character. +In information theory and computer science, the Levenshtein distance is a metric for measuring the amount of difference between two sequences (i.e. an edit distance). The Levenshtein distance between two strings is defined as the minimum number of edits needed to transform one string into the other, with the allowable edit operations being insertion, deletion, or substitution of a single character. Example: -The Levenshtein distance between "kitten" and "sitting" is 3, since the following three edits change one into the other, and there isn't a way to do it with fewer than three edits: -kitten sitten (substitution of 'k' with 's') -sitten sittin (substitution of 'e' with 'i') -sittin sitting (insert 'g' at the end). -''The Levenshtein distance between "rosettacode", "raisethysword" is 8. +The Levenshtein distance between "kitten" and "sitting" is 3, since the following three edits change one into the other, and there isn't a way to do it with fewer than three edits: +
    +
  • kitten   sitten    (substitution of 'k' with 's')
  • +
  • sitten   sittin    (substitution of 'e' with 'i')
  • +
  • sittin   sitting    (insert 'g' at the end).
  • +
+The Levenshtein distance between   "rosettacode",   "raisethysword"   is 8. The distance between two strings is same as that when both strings are reversed.
## Instructions
-Write a function that returns the Levenshtein distance between two strings given as parameters . +Write a function that returns the Levenshtein distance between two strings given as parameters.
## Tests @@ -52,7 +54,7 @@ tests:
```js -function levenshtein (a, b) { +function levenshtein(a, b) { // Good luck! } ``` @@ -65,7 +67,7 @@ function levenshtein (a, b) {
```js -function levenshtein (a, b) { +function levenshtein(a, b) { var t = [], u, i, j, m = a.length, n = b.length; if (!m) { return n; } if (!n) { return m; } diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/linear-congruential-generator.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/linear-congruential-generator.md index 2b92a0daeb..228d67d934 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/linear-congruential-generator.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/linear-congruential-generator.md @@ -52,7 +52,7 @@ tests:
```js -function linearCongGenerator (r0, a, c, m, n) { +function linearCongGenerator(r0, a, c, m, n) { // Good luck! } ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/long-multiplication.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/long-multiplication.md index 745b0a87c8..7d550f997a 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/long-multiplication.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/long-multiplication.md @@ -8,12 +8,12 @@ challengeType: 5
Explicitly implement long multiplication. This is one possible approach to arbitrary-precision integer algebra. -Note: In JavaScript, arithmetic operations are inaccurate with large numbers, so you will have to implement precise multiplication yourself.
## Instructions
Write a function that takes two strings of large numbers as parameters. Your function should return the product of these two large numbers as a string. +Note: In JavaScript, arithmetic operations are inaccurate with large numbers, so you will have to implement precise multiplication yourself.
## Tests @@ -45,7 +45,7 @@ tests:
```js -function mult (strNum1, strNum2) { +function mult(strNum1, strNum2) { // Good luck! } ```