diff --git a/curriculum/challenges/english/01-responsive-web-design/applied-accessibility/add-a-text-alternative-to-images-for-visually-impaired-accessibility.english.md b/curriculum/challenges/english/01-responsive-web-design/applied-accessibility/add-a-text-alternative-to-images-for-visually-impaired-accessibility.english.md index 6575fc8a4d..5413bea7bc 100644 --- a/curriculum/challenges/english/01-responsive-web-design/applied-accessibility/add-a-text-alternative-to-images-for-visually-impaired-accessibility.english.md +++ b/curriculum/challenges/english/01-responsive-web-design/applied-accessibility/add-a-text-alternative-to-images-for-visually-impaired-accessibility.english.md @@ -25,7 +25,7 @@ Camper Cat happens to be both a coding ninja and an actual ninja, and is buildin ```yml tests: - text: 'Your img tag should have an alt attribute, and it should not be empty.' - testString: 'assert($(''img'').attr(''alt''), ''Your img tag should have an alt attribute, and it should not be empty.'');' + testString: 'assert($("img").attr("alt"), "Your img tag should have an alt attribute, and it should not be empty.");' ``` diff --git a/curriculum/challenges/english/01-responsive-web-design/applied-accessibility/add-an-accessible-date-picker.english.md b/curriculum/challenges/english/01-responsive-web-design/applied-accessibility/add-an-accessible-date-picker.english.md index f80381874f..937db0dab8 100644 --- a/curriculum/challenges/english/01-responsive-web-design/applied-accessibility/add-an-accessible-date-picker.english.md +++ b/curriculum/challenges/english/01-responsive-web-design/applied-accessibility/add-an-accessible-date-picker.english.md @@ -25,13 +25,13 @@ Camper Cat is setting up a Mortal Kombat tournament and wants to ask his competi ```yml tests: - text: Your code should add one input tag for the date selector field. - testString: 'assert($(''input'').length == 2, ''Your code should add one input tag for the date selector field.'');' + testString: 'assert($("input").length == 2, "Your code should add one input tag for the date selector field.");' - text: Your input tag should have a type attribute with a value of date. - testString: 'assert($(''input'').attr(''type'') == ''date'', ''Your input tag should have a type attribute with a value of date.'');' + testString: 'assert($("input").attr("type") == "date", "Your input tag should have a type attribute with a value of date.");' - text: Your input tag should have an id attribute with a value of pickdate. - testString: 'assert($(''input'').attr(''id'') == ''pickdate'', ''Your input tag should have an id attribute with a value of pickdate.'');' + testString: 'assert($("input").attr("id") == "pickdate", "Your input tag should have an id attribute with a value of pickdate.");' - text: Your input tag should have a name attribute with a value of date. - testString: 'assert($(''input'').attr(''name'') == ''date'', ''Your input tag should have a name attribute with a value of date.'');' + testString: 'assert($("input").attr("name") == "date", "Your input tag should have a name attribute with a value of date.");' ``` @@ -53,13 +53,13 @@ tests:

Tell us the best date for the competition

- + - - - + + + - +
diff --git a/curriculum/challenges/english/01-responsive-web-design/applied-accessibility/avoid-colorblindness-issues-by-carefully-choosing-colors-that-convey-information.english.md b/curriculum/challenges/english/01-responsive-web-design/applied-accessibility/avoid-colorblindness-issues-by-carefully-choosing-colors-that-convey-information.english.md index 7522a6eed4..555177dcdc 100644 --- a/curriculum/challenges/english/01-responsive-web-design/applied-accessibility/avoid-colorblindness-issues-by-carefully-choosing-colors-that-convey-information.english.md +++ b/curriculum/challenges/english/01-responsive-web-design/applied-accessibility/avoid-colorblindness-issues-by-carefully-choosing-colors-that-convey-information.english.md @@ -23,7 +23,7 @@ Camper Cat is testing different styles for an important button, but the yellow ( ```yml tests: - text: Your code should change the text color for the button to the dark blue. - testString: 'assert($(''button'').css(''color'') == ''rgb(0, 51, 102)'', ''Your code should change the text color for the button to the dark blue.'');' + testString: 'assert($("button").css("color") == "rgb(0, 51, 102)", "Your code should change the text color for the button to the dark blue.");' ``` diff --git a/curriculum/challenges/english/01-responsive-web-design/applied-accessibility/avoid-colorblindness-issues-by-using-sufficient-contrast.english.md b/curriculum/challenges/english/01-responsive-web-design/applied-accessibility/avoid-colorblindness-issues-by-using-sufficient-contrast.english.md index fd74518506..b605778eaa 100644 --- a/curriculum/challenges/english/01-responsive-web-design/applied-accessibility/avoid-colorblindness-issues-by-using-sufficient-contrast.english.md +++ b/curriculum/challenges/english/01-responsive-web-design/applied-accessibility/avoid-colorblindness-issues-by-using-sufficient-contrast.english.md @@ -24,9 +24,9 @@ Camper Cat is experimenting with using color for his blog text and background, b ```yml tests: - text: Your code should only change the lightness value for the text color property to a value of 15%. - testString: 'assert(code.match(/color:\s*?hsl\(0,\s*?55%,\s*?15%\)/gi), ''Your code should only change the lightness value for the text color property to a value of 15%.'');' + testString: 'assert(code.match(/color:\s*?hsl\(0,\s*?55%,\s*?15%\)/gi), "Your code should only change the lightness value for the text color property to a value of 15%.");' - text: Your code should only change the lightness value for the background-color property to a value of 55%. - testString: 'assert(code.match(/background-color:\s*?hsl\(120,\s*?25%,\s*?55%\)/gi), ''Your code should only change the lightness value for the background-color property to a value of 55%.'');' + testString: 'assert(code.match(/background-color:\s*?hsl\(120,\s*?25%,\s*?55%\)/gi), "Your code should only change the lightness value for the background-color property to a value of 55%.");' ``` diff --git a/curriculum/challenges/english/01-responsive-web-design/applied-accessibility/give-links-meaning-by-using-descriptive-link-text.english.md b/curriculum/challenges/english/01-responsive-web-design/applied-accessibility/give-links-meaning-by-using-descriptive-link-text.english.md index 333722e4fd..e5a3f8a07c 100644 --- a/curriculum/challenges/english/01-responsive-web-design/applied-accessibility/give-links-meaning-by-using-descriptive-link-text.english.md +++ b/curriculum/challenges/english/01-responsive-web-design/applied-accessibility/give-links-meaning-by-using-descriptive-link-text.english.md @@ -22,9 +22,9 @@ The link text that Camper Cat is using is not very descriptive without the surro ```yml tests: - text: Your code should move the anchor a tags from around the words "Click here" to wrap around the words "information about batteries". - testString: 'assert($(''a'').text().match(/^(information about batteries)$/g), ''Your code should move the anchor a tags from around the words "Click here" to wrap around the words "information about batteries".'');' + testString: 'assert($("a").text().match(/^(information about batteries)$/g), "Your code should move the anchor a tags from around the words "Click here" to wrap around the words "information about batteries".");' - text: Make sure your a element has a closing tag. - testString: 'assert(code.match(/<\/a>/g) && code.match(/<\/a>/g).length === code.match(//g).length, ''Make sure your a element has a closing tag.'');' + testString: 'assert(code.match(/<\/a>/g) && code.match(/<\/a>/g).length === code.match(//g).length, "Make sure your a element has a closing tag.");' ``` diff --git a/curriculum/challenges/english/01-responsive-web-design/applied-accessibility/improve-accessibility-of-audio-content-with-the-audio-element.english.md b/curriculum/challenges/english/01-responsive-web-design/applied-accessibility/improve-accessibility-of-audio-content-with-the-audio-element.english.md index 6f4cb673b4..a234e6ff5c 100644 --- a/curriculum/challenges/english/01-responsive-web-design/applied-accessibility/improve-accessibility-of-audio-content-with-the-audio-element.english.md +++ b/curriculum/challenges/english/01-responsive-web-design/applied-accessibility/improve-accessibility-of-audio-content-with-the-audio-element.english.md @@ -26,19 +26,19 @@ Time to take a break from Camper Cat and meet fellow camper Zersiax (@zersiax), ```yml tests: - text: Your code should have one audio tag. - testString: 'assert($(''audio'').length === 1, ''Your code should have one audio tag.'');' + testString: 'assert($("audio").length === 1, "Your code should have one audio tag.");' - text: Make sure your audio element has a closing tag. - testString: 'assert(code.match(/<\/audio>/g).length === 1 && code.match(/[\s\S]*<\/audio>/g), ''Make sure your audio element has a closing tag.'');' + testString: 'assert(code.match(/<\/audio>/g).length === 1 && code.match(/[\s\S]*<\/audio>/g), "Make sure your audio element has a closing tag.");' - text: The audio tag should have the controls attribute. - testString: 'assert($(''audio'').attr(''controls''), ''The audio tag should have the controls attribute.'');' + testString: 'assert($("audio").attr("controls"), "The audio tag should have the controls attribute.");' - text: Your code should have one source tag. - testString: 'assert($(''source'').length === 1, ''Your code should have one source tag.'');' + testString: 'assert($("source").length === 1, "Your code should have one source tag.");' - text: Your source tag should be inside the audio tags. - testString: 'assert($(''audio'').children(''source'').length === 1, ''Your source tag should be inside the audio tags.'');' + testString: 'assert($("audio").children("source").length === 1, "Your source tag should be inside the audio tags.");' - text: The value for the src attribute on the source tag should match the link in the instructions exactly. - testString: 'assert($(''source'').attr(''src'') === ''https://s3.amazonaws.com/freecodecamp/screen-reader.mp3'', ''The value for the src attribute on the source tag should match the link in the instructions exactly.'');' + testString: 'assert($("source").attr("src") === "https://s3.amazonaws.com/freecodecamp/screen-reader.mp3", "The value for the src attribute on the source tag should match the link in the instructions exactly.");' - text: Your code should include a type attribute on the source tag with a value of audio/mpeg. - testString: 'assert($(''source'').attr(''type'') === ''audio/mpeg'', ''Your code should include a type attribute on the source tag with a value of audio/mpeg.'');' + testString: 'assert($("source").attr("type") === "audio/mpeg", "Your code should include a type attribute on the source tag with a value of audio/mpeg.");' ``` @@ -56,9 +56,9 @@ tests:

A sound clip of Zersiax's screen reader in action.

- - - + + +
``` diff --git a/curriculum/challenges/english/01-responsive-web-design/applied-accessibility/improve-chart-accessibility-with-the-figure-element.english.md b/curriculum/challenges/english/01-responsive-web-design/applied-accessibility/improve-chart-accessibility-with-the-figure-element.english.md index afe047aa8c..08200b9341 100644 --- a/curriculum/challenges/english/01-responsive-web-design/applied-accessibility/improve-chart-accessibility-with-the-figure-element.english.md +++ b/curriculum/challenges/english/01-responsive-web-design/applied-accessibility/improve-chart-accessibility-with-the-figure-element.english.md @@ -24,17 +24,17 @@ Camper Cat is hard at work creating a stacked bar chart showing the amount of ti ```yml tests: - text: Your code should have one figure tag. - testString: 'assert($(''figure'').length == 1, ''Your code should have one figure tag.'');' + testString: 'assert($("figure").length == 1, "Your code should have one figure tag.");' - text: Your code should have one figcaption tag. - testString: 'assert($(''figcaption'').length == 1, ''Your code should have one figcaption tag.'');' + testString: 'assert($("figcaption").length == 1, "Your code should have one figcaption tag.");' - text: Your code should not have any div tags. - testString: 'assert($(''div'').length == 0, ''Your code should not have any div tags.'');' + testString: 'assert($("div").length == 0, "Your code should not have any div tags.");' - text: Your code should not have any p tags. - testString: 'assert($(''p'').length == 0, ''Your code should not have any p tags.'');' + testString: 'assert($("p").length == 0, "Your code should not have any p tags.");' - text: The figcaption should be a child of the figure tag. - testString: 'assert($(''figure'').children(''figcaption'').length == 1, ''The figcaption should be a child of the figure tag.'');' + testString: 'assert($("figure").children("figcaption").length == 1, "The figcaption should be a child of the figure tag.");' - text: Make sure your figure element has a closing tag. - testString: 'assert(code.match(/<\/figure>/g) && code.match(/<\/figure>/g).length === code.match(/
/g).length, ''Make sure your figure element has a closing tag.'');' + testString: 'assert(code.match(/<\/figure>/g) && code.match(/<\/figure>/g).length === code.match(/
/g).length, "Make sure your figure element has a closing tag.");' ``` @@ -59,7 +59,7 @@ tests:
- +
@@ -67,7 +67,7 @@ tests:

Breakdown per week of time to spend training in stealth, combat, and weapons.

- +

Stealth & Agility Training

diff --git a/curriculum/challenges/english/01-responsive-web-design/applied-accessibility/improve-form-field-accessibility-with-the-label-element.english.md b/curriculum/challenges/english/01-responsive-web-design/applied-accessibility/improve-form-field-accessibility-with-the-label-element.english.md index 4269142321..747b79f382 100644 --- a/curriculum/challenges/english/01-responsive-web-design/applied-accessibility/improve-form-field-accessibility-with-the-label-element.english.md +++ b/curriculum/challenges/english/01-responsive-web-design/applied-accessibility/improve-form-field-accessibility-with-the-label-element.english.md @@ -25,9 +25,9 @@ Camper Cat expects a lot of interest in his thoughtful blog posts, and wants to ```yml tests: - text: Your code should have a for attribute on the label tag that is not empty. - testString: 'assert($(''label'').attr(''for''), ''Your code should have a for attribute on the label tag that is not empty.'');' + testString: 'assert($("label").attr("for"), "Your code should have a for attribute on the label tag that is not empty.");' - text: Your for attribute value should match the id value on the email input. - testString: 'assert($(''label'').attr(''for'') == ''email'', ''Your for attribute value should match the id value on the email input.'');' + testString: 'assert($("label").attr("for") == "email", "Your for attribute value should match the id value on the email input.");' ``` @@ -46,12 +46,12 @@ tests:

Sign up to receive Camper Cat's blog posts by email here!

- - + + - - + +
diff --git a/curriculum/challenges/english/01-responsive-web-design/applied-accessibility/improve-readability-with-high-contrast-text.english.md b/curriculum/challenges/english/01-responsive-web-design/applied-accessibility/improve-readability-with-high-contrast-text.english.md index 57b5d4bead..959d21a11c 100644 --- a/curriculum/challenges/english/01-responsive-web-design/applied-accessibility/improve-readability-with-high-contrast-text.english.md +++ b/curriculum/challenges/english/01-responsive-web-design/applied-accessibility/improve-readability-with-high-contrast-text.english.md @@ -22,9 +22,9 @@ Camper Cat's choice of light gray text on a white background for his recent blog ```yml tests: - text: Your code should change the text color for the body to the darker gray. - testString: 'assert($(''body'').css(''color'') == ''rgb(99, 99, 99)'', ''Your code should change the text color for the body to the darker gray.'');' + testString: 'assert($("body").css("color") == "rgb(99, 99, 99)", "Your code should change the text color for the body to the darker gray.");' - text: Your code should not change the background-color for the body. - testString: 'assert($(''body'').css(''background-color'') == ''rgb(255, 255, 255)'', ''Your code should not change the background-color for the body.'');' + testString: 'assert($("body").css("background-color") == "rgb(255, 255, 255)", "Your code should not change the background-color for the body.");' ``` diff --git a/curriculum/challenges/english/01-responsive-web-design/applied-accessibility/jump-straight-to-the-content-using-the-main-element.english.md b/curriculum/challenges/english/01-responsive-web-design/applied-accessibility/jump-straight-to-the-content-using-the-main-element.english.md index 4a6e91129f..5251438082 100644 --- a/curriculum/challenges/english/01-responsive-web-design/applied-accessibility/jump-straight-to-the-content-using-the-main-element.english.md +++ b/curriculum/challenges/english/01-responsive-web-design/applied-accessibility/jump-straight-to-the-content-using-the-main-element.english.md @@ -24,9 +24,9 @@ Camper Cat has some big ideas for his ninja weapons page. Help him set up his ma ```yml tests: - text: Your code should have one main tag. - testString: 'assert($(''main'').length == 1, ''Your code should have one main tag.'');' + testString: 'assert($("main").length == 1, "Your code should have one main tag.");' - text: The main tags should be between the closing header tag and the opening footer tag. - testString: 'assert(code.match(/<\/header>\s*?
\s*?<\/main>/gi), ''The main tags should be between the closing header tag and the opening footer tag.'');' + testString: 'assert(code.match(/<\/header>\s*?
\s*?<\/main>/gi), "The main tags should be between the closing header tag and the opening footer tag.");' ``` diff --git a/curriculum/challenges/english/01-responsive-web-design/applied-accessibility/know-when-alt-text-should-be-left-blank.english.md b/curriculum/challenges/english/01-responsive-web-design/applied-accessibility/know-when-alt-text-should-be-left-blank.english.md index c324785fcc..173de4642d 100644 --- a/curriculum/challenges/english/01-responsive-web-design/applied-accessibility/know-when-alt-text-should-be-left-blank.english.md +++ b/curriculum/challenges/english/01-responsive-web-design/applied-accessibility/know-when-alt-text-should-be-left-blank.english.md @@ -25,9 +25,9 @@ Camper Cat has coded a skeleton page for the blog part of his website. He's plan ```yml tests: - text: Your img tag should have an alt attribute. - testString: 'assert(!($(''img'').attr(''alt'') == undefined), ''Your img tag should have an alt attribute.'');' + testString: 'assert(!($("img").attr("alt") == undefined), "Your img tag should have an alt attribute.");' - text: The alt attribute should be set to an empty string. - testString: 'assert($(''img'').attr(''alt'') == '''', ''The alt attribute should be set to an empty string.'');' + testString: 'assert($("img").attr("alt") == "", "The alt attribute should be set to an empty string.");' ``` diff --git a/curriculum/challenges/english/01-responsive-web-design/applied-accessibility/make-elements-only-visible-to-a-screen-reader-by-using-custom-css.english.md b/curriculum/challenges/english/01-responsive-web-design/applied-accessibility/make-elements-only-visible-to-a-screen-reader-by-using-custom-css.english.md index 49d0c07add..8f67b0c4c7 100644 --- a/curriculum/challenges/english/01-responsive-web-design/applied-accessibility/make-elements-only-visible-to-a-screen-reader-by-using-custom-css.english.md +++ b/curriculum/challenges/english/01-responsive-web-design/applied-accessibility/make-elements-only-visible-to-a-screen-reader-by-using-custom-css.english.md @@ -29,13 +29,13 @@ Camper Cat created a really cool stacked bar chart for his training page, and pu ```yml tests: - text: Your code should set the position property of the sr-only class to a value of absolute. - testString: 'assert($(''.sr-only'').css(''position'') == ''absolute'', ''Your code should set the position property of the sr-only class to a value of absolute.'');' + testString: 'assert($(".sr-only").css("position") == "absolute", "Your code should set the position property of the sr-only class to a value of absolute.");' - text: Your code should set the left property of the sr-only class to a value of -10000px. - testString: 'assert($(''.sr-only'').css(''left'') == ''-10000px'', ''Your code should set the left property of the sr-only class to a value of -10000px.'');' + testString: 'assert($(".sr-only").css("left") == "-10000px", "Your code should set the left property of the sr-only class to a value of -10000px.");' - text: Your code should set the width property of the sr-only class to a value of 1 pixel. - testString: 'assert(code.match(/width:\s*?1px/gi), ''Your code should set the width property of the sr-only class to a value of 1 pixel.'');' + testString: 'assert(code.match(/width:\s*?1px/gi), "Your code should set the width property of the sr-only class to a value of 1 pixel.");' - text: Your code should set the height property of the sr-only class to a value of 1 pixel. - testString: 'assert(code.match(/height:\s*?1px/gi), ''Your code should set the height property of the sr-only class to a value of 1 pixel.'');' + testString: 'assert(code.match(/height:\s*?1px/gi), "Your code should set the height property of the sr-only class to a value of 1 pixel.");' ``` @@ -86,7 +86,7 @@ tests: Stealth & Agility Combat Weapons - Total + Total diff --git a/curriculum/challenges/english/01-responsive-web-design/applied-accessibility/make-links-navigatable-with-html-access-keys.english.md b/curriculum/challenges/english/01-responsive-web-design/applied-accessibility/make-links-navigatable-with-html-access-keys.english.md index c2fe5aa918..120cda2cea 100644 --- a/curriculum/challenges/english/01-responsive-web-design/applied-accessibility/make-links-navigatable-with-html-access-keys.english.md +++ b/curriculum/challenges/english/01-responsive-web-design/applied-accessibility/make-links-navigatable-with-html-access-keys.english.md @@ -24,13 +24,13 @@ Camper Cat wants the links around the two blog article titles to have keyboard s ```yml tests: - text: Your code should add an accesskey attribute to the a tag with the id of "first". - testString: 'assert($(''#first'').attr(''accesskey''), ''Your code should add an accesskey attribute to the a tag with the id of "first".'');' + testString: 'assert($("#first").attr("accesskey"), "Your code should add an accesskey attribute to the a tag with the id of "first".");' - text: Your code should add an accesskey attribute to the a tag with the id of "second". - testString: 'assert($(''#second'').attr(''accesskey''), ''Your code should add an accesskey attribute to the a tag with the id of "second".'');' + testString: 'assert($("#second").attr("accesskey"), "Your code should add an accesskey attribute to the a tag with the id of "second".");' - text: Your code should set the accesskey attribute on the a tag with the id of "first" to "g". Note that case matters. - testString: 'assert($(''#first'').attr(''accesskey'') == ''g'', ''Your code should set the accesskey attribute on the a tag with the id of "first" to "g". Note that case matters.'');' + testString: 'assert($("#first").attr("accesskey") == "g", "Your code should set the accesskey attribute on the a tag with the id of "first" to "g". Note that case matters.");' - text: Your code should set the accesskey attribute on the a tag with the id of "second" to "c". Note that case matters. - testString: 'assert($(''#second'').attr(''accesskey'') == ''c'', ''Your code should set the accesskey attribute on the a tag with the id of "second" to "c". Note that case matters.'');' + testString: 'assert($("#second").attr("accesskey") == "c", "Your code should set the accesskey attribute on the a tag with the id of "second" to "c". Note that case matters.");' ``` @@ -47,19 +47,19 @@ tests:

Deep Thoughts with Master Camper Cat

- - + +

Is Chuck Norris a Cat Person?

- - + +

Chuck Norris is widely regarded as the premier martial artist on the planet, and it's a complete coincidence anyone who disagrees with this fact mysteriously disappears soon after. But the real question is, is he a cat person?...

© 2018 Camper Cat
diff --git a/curriculum/challenges/english/01-responsive-web-design/applied-accessibility/make-screen-reader-navigation-easier-with-the-footer-landmark.english.md b/curriculum/challenges/english/01-responsive-web-design/applied-accessibility/make-screen-reader-navigation-easier-with-the-footer-landmark.english.md index 9996c2b39a..48cdc6d434 100644 --- a/curriculum/challenges/english/01-responsive-web-design/applied-accessibility/make-screen-reader-navigation-easier-with-the-footer-landmark.english.md +++ b/curriculum/challenges/english/01-responsive-web-design/applied-accessibility/make-screen-reader-navigation-easier-with-the-footer-landmark.english.md @@ -21,11 +21,11 @@ Camper Cat's training page is making good progress. Change the div ```yml tests: - text: Your code should have one footer tag. - testString: 'assert($(''footer'').length == 1, ''Your code should have one footer tag.'');' + testString: 'assert($("footer").length == 1, "Your code should have one footer tag.");' - text: Your code should not have any div tags. - testString: 'assert($(''div'').length == 0, ''Your code should not have any div tags.'');' + testString: 'assert($("div").length == 0, "Your code should not have any div tags.");' - text: Your code should have an opening and closing footer tag. - testString: 'assert(code.match(/
@@ -29,9 +29,9 @@ Submit your page when you think you've got it right. If you're running into erro ```yml tests: - text: Route /auth/github correct - testString: 'getUserInput => $.get(getUserInput(''url'')+ ''/_api/server.js'') .then(data => { assert.match(data, /(''|")\/auth\/github(''|")[^]*get.*passport.authenticate.*github/gi, ''Route auth/github should only call passport.authenticate with github''); }, xhr => { throw new Error(xhr.statusText); })' + testString: 'getUserInput => $.get(getUserInput("url")+ "/_api/server.js") .then(data => { assert.match(data, /("|")\/auth\/github("|")[^]*get.*passport.authenticate.*github/gi, "Route auth/github should only call passport.authenticate with github"); }, xhr => { throw new Error(xhr.statusText); })' - text: Route /auth/github/callback correct - testString: 'getUserInput => $.get(getUserInput(''url'')+ ''/_api/server.js'') .then(data => { assert.match(data, /(''|")\/auth\/github\/callback(''|")[^]*get.*passport.authenticate.*github.*failureRedirect:( |)("|'')\/("|'')/gi, ''Route auth/github/callback should accept a get request and call passport.authenticate for github with a failure redirect to home''); }, xhr => { throw new Error(xhr.statusText); })' + testString: 'getUserInput => $.get(getUserInput("url")+ "/_api/server.js") .then(data => { assert.match(data, /("|")\/auth\/github\/callback("|")[^]*get.*passport.authenticate.*github.*failureRedirect:( |)("|")\/("|")/gi, "Route auth/github/callback should accept a get request and call passport.authenticate for github with a failure redirect to home"); }, xhr => { throw new Error(xhr.statusText); })' ``` diff --git a/curriculum/challenges/english/06-information-security-and-quality-assurance/advanced-node-and-express/logging-a-user-out.english.md b/curriculum/challenges/english/06-information-security-and-quality-assurance/advanced-node-and-express/logging-a-user-out.english.md index 3ee25989f2..c78cbc1533 100644 --- a/curriculum/challenges/english/06-information-security-and-quality-assurance/advanced-node-and-express/logging-a-user-out.english.md +++ b/curriculum/challenges/english/06-information-security-and-quality-assurance/advanced-node-and-express/logging-a-user-out.english.md @@ -34,9 +34,9 @@ Submit your page when you think you've got it right. ```yml tests: - text: Logout route - testString: 'getUserInput => $.get(getUserInput(''url'')+ ''/_api/server.js'') .then(data => { assert.match(data, /req.logout/gi, ''You should be call req.logout() in youre /logout route''); }, xhr => { throw new Error(xhr.statusText); })' + testString: 'getUserInput => $.get(getUserInput("url")+ "/_api/server.js") .then(data => { assert.match(data, /req.logout/gi, "You should be call req.logout() in youre /logout route"); }, xhr => { throw new Error(xhr.statusText); })' - text: Logout should redirect to the home page / - testString: 'getUserInput => $.get(getUserInput(''url'')+ ''/logout'') .then(data => { assert.match(data, /Home page/gi, ''When a user logs out they should be redirected to the homepage''); }, xhr => { throw new Error(xhr.statusText); })' + testString: 'getUserInput => $.get(getUserInput("url")+ "/logout") .then(data => { assert.match(data, /Home page/gi, "When a user logs out they should be redirected to the homepage"); }, xhr => { throw new Error(xhr.statusText); })' ``` diff --git a/curriculum/challenges/english/06-information-security-and-quality-assurance/advanced-node-and-express/registration-of-new-users.english.md b/curriculum/challenges/english/06-information-security-and-quality-assurance/advanced-node-and-express/registration-of-new-users.english.md index df765161bf..87f6211219 100644 --- a/curriculum/challenges/english/06-information-security-and-quality-assurance/advanced-node-and-express/registration-of-new-users.english.md +++ b/curriculum/challenges/english/06-information-security-and-quality-assurance/advanced-node-and-express/registration-of-new-users.english.md @@ -50,15 +50,15 @@ Submit your page when you think you've got it right. If you're running into erro ```yml tests: - text: Register route and display on home - testString: 'getUserInput => $.get(getUserInput(''url'')+ ''/_api/server.js'') .then(data => { assert.match(data, /showRegistration:( |)true/gi, ''You should be passing the variable "showRegistration" as true to your render function for the homepage''); assert.match(data, /register[^]*post[^]*findOne[^]*username:( |)req.body.username/gi, ''You should have a route accepted a post request on register that querys the db with findone and the query being "username: req.body.username"''); }, xhr => { throw new Error(xhr.statusText); })' + testString: 'getUserInput => $.get(getUserInput("url")+ "/_api/server.js") .then(data => { assert.match(data, /showRegistration:( |)true/gi, "You should be passing the variable "showRegistration" as true to your render function for the homepage"); assert.match(data, /register[^]*post[^]*findOne[^]*username:( |)req.body.username/gi, "You should have a route accepted a post request on register that querys the db with findone and the query being "username: req.body.username""); }, xhr => { throw new Error(xhr.statusText); })' - text: Registering should work - testString: 'getUserInput => $.ajax({url: getUserInput(''url'')+ ''/register'',data: {username: ''freeCodeCampTester'', password: ''freeCodeCampTester''},crossDomain: true, type: ''POST'', xhrFields: { withCredentials: true }}) .then(data => { assert.match(data, /Profile/gi, ''I should be able to register and it direct me to my profile. CLEAR YOUR DATABASE if this test fails (each time until its right!)''); }, xhr => { throw new Error(xhr.statusText); })' + testString: 'getUserInput => $.ajax({url: getUserInput("url")+ "/register",data: {username: "freeCodeCampTester", password: "freeCodeCampTester"},crossDomain: true, type: "POST", xhrFields: { withCredentials: true }}) .then(data => { assert.match(data, /Profile/gi, "I should be able to register and it direct me to my profile. CLEAR YOUR DATABASE if this test fails (each time until its right!)"); }, xhr => { throw new Error(xhr.statusText); })' - text: Login should work - testString: 'getUserInput => $.ajax({url: getUserInput(''url'')+ ''/login'',data: {username: ''freeCodeCampTester'', password: ''freeCodeCampTester''}, type: ''POST'', xhrFields: { withCredentials: true }}) .then(data => { assert.match(data, /Profile/gi, ''Login should work if previous test was done successfully and redirect successfully to the profile. Check your work and clear your DB''); assert.match(data, /freeCodeCampTester/gi, ''The profile should properly display the welcome to the user logged in''); }, xhr => { throw new Error(xhr.statusText); })' + testString: 'getUserInput => $.ajax({url: getUserInput("url")+ "/login",data: {username: "freeCodeCampTester", password: "freeCodeCampTester"}, type: "POST", xhrFields: { withCredentials: true }}) .then(data => { assert.match(data, /Profile/gi, "Login should work if previous test was done successfully and redirect successfully to the profile. Check your work and clear your DB"); assert.match(data, /freeCodeCampTester/gi, "The profile should properly display the welcome to the user logged in"); }, xhr => { throw new Error(xhr.statusText); })' - text: Logout should work - testString: 'getUserInput => $.ajax({url: getUserInput(''url'')+ ''/logout'', type: ''GET'', xhrFields: { withCredentials: true }}) .then(data => { assert.match(data, /Home/gi, ''Logout should redirect to home''); }, xhr => { throw new Error(xhr.statusText); })' + testString: 'getUserInput => $.ajax({url: getUserInput("url")+ "/logout", type: "GET", xhrFields: { withCredentials: true }}) .then(data => { assert.match(data, /Home/gi, "Logout should redirect to home"); }, xhr => { throw new Error(xhr.statusText); })' - text: Profile should no longer work after logout - testString: 'getUserInput => $.ajax({url: getUserInput(''url'')+ ''/profile'', type: ''GET'', crossDomain: true, xhrFields: { withCredentials: true }}) .then(data => { assert.match(data, /Home/gi, ''Profile should redirect to home when we are logged out now again''); }, xhr => { throw new Error(xhr.statusText); })' + testString: 'getUserInput => $.ajax({url: getUserInput("url")+ "/profile", type: "GET", crossDomain: true, xhrFields: { withCredentials: true }}) .then(data => { assert.match(data, /Home/gi, "Profile should redirect to home when we are logged out now again"); }, xhr => { throw new Error(xhr.statusText); })' ``` diff --git a/curriculum/challenges/english/06-information-security-and-quality-assurance/advanced-node-and-express/send-and-display-chat-messages.english.md b/curriculum/challenges/english/06-information-security-and-quality-assurance/advanced-node-and-express/send-and-display-chat-messages.english.md index a7cb785e1a..2593af1892 100644 --- a/curriculum/challenges/english/06-information-security-and-quality-assurance/advanced-node-and-express/send-and-display-chat-messages.english.md +++ b/curriculum/challenges/english/06-information-security-and-quality-assurance/advanced-node-and-express/send-and-display-chat-messages.english.md @@ -25,9 +25,9 @@ At this point the chat should be fully functional and sending messages across al ```yml tests: - text: Server listens for 'chat message' then emits it properly - testString: 'getUserInput => $.get(getUserInput(''url'')+ ''/_api/server.js'') .then(data => { assert.match(data, /socket.on.*(''|")chat message(''|")[^]*io.emit.*(''|")chat message(''|").*name.*message/gi, ''Your server should listen to the socket for "chat message" then emit to all users "chat message" with name and message in the data object''); }, xhr => { throw new Error(xhr.statusText); })' + testString: 'getUserInput => $.get(getUserInput("url")+ "/_api/server.js") .then(data => { assert.match(data, /socket.on.*("|")chat message("|")[^]*io.emit.*("|")chat message("|").*name.*message/gi, "Your server should listen to the socket for "chat message" then emit to all users "chat message" with name and message in the data object"); }, xhr => { throw new Error(xhr.statusText); })' - text: Client properly handling and displaying the new data from event 'chat message' - testString: 'getUserInput => $.get(getUserInput(''url'')+ ''/public/client.js'') .then(data => { assert.match(data, /socket.on.*(''|")chat message(''|")[^]*messages.*li/gi, ''You should append a list item to #messages on your client within the "chat message" event listener to display the new message''); }, xhr => { throw new Error(xhr.statusText); })' + testString: 'getUserInput => $.get(getUserInput("url")+ "/public/client.js") .then(data => { assert.match(data, /socket.on.*("|")chat message("|")[^]*messages.*li/gi, "You should append a list item to #messages on your client within the "chat message" event listener to display the new message"); }, xhr => { throw new Error(xhr.statusText); })' ``` diff --git a/curriculum/challenges/english/06-information-security-and-quality-assurance/advanced-node-and-express/serialization-of-a-user-object.english.md b/curriculum/challenges/english/06-information-security-and-quality-assurance/advanced-node-and-express/serialization-of-a-user-object.english.md index a4e621a986..7346062464 100644 --- a/curriculum/challenges/english/06-information-security-and-quality-assurance/advanced-node-and-express/serialization-of-a-user-object.english.md +++ b/curriculum/challenges/english/06-information-security-and-quality-assurance/advanced-node-and-express/serialization-of-a-user-object.english.md @@ -35,13 +35,13 @@ Submit your page when you think you've got it right. ```yml tests: - text: Serialize user function correct - testString: 'getUserInput => $.get(getUserInput(''url'')+ ''/_api/server.js'') .then(data => { assert.match(data, /passport.serializeUser/gi, ''You should have created your passport.serializeUser function''); assert.match(data, /null, user._id/gi, ''There should be a callback in your serializeUser with (null, user._id)''); }, xhr => { throw new Error(xhr.statusText); })' + testString: 'getUserInput => $.get(getUserInput("url")+ "/_api/server.js") .then(data => { assert.match(data, /passport.serializeUser/gi, "You should have created your passport.serializeUser function"); assert.match(data, /null, user._id/gi, "There should be a callback in your serializeUser with (null, user._id)"); }, xhr => { throw new Error(xhr.statusText); })' - text: Deserialize user function correct - testString: 'getUserInput => $.get(getUserInput(''url'')+ ''/_api/server.js'') .then(data => { assert.match(data, /passport.deserializeUser/gi, ''You should have created your passport.deserializeUser function''); assert.match(data, /null,( |)null/gi, ''There should be a callback in your deserializeUser with (null, null) for now''); }, xhr => { throw new Error(xhr.statusText); })' + testString: 'getUserInput => $.get(getUserInput("url")+ "/_api/server.js") .then(data => { assert.match(data, /passport.deserializeUser/gi, "You should have created your passport.deserializeUser function"); assert.match(data, /null,( |)null/gi, "There should be a callback in your deserializeUser with (null, null) for now"); }, xhr => { throw new Error(xhr.statusText); })' - text: MongoDB is a dependency - testString: 'getUserInput => $.get(getUserInput(''url'')+ ''/_api/package.json'') .then(data => { var packJson = JSON.parse(data); assert.property(packJson.dependencies, ''mongodb'', ''Your project should list "mongodb" as a dependency''); }, xhr => { throw new Error(xhr.statusText); })' + testString: 'getUserInput => $.get(getUserInput("url")+ "/_api/package.json") .then(data => { var packJson = JSON.parse(data); assert.property(packJson.dependencies, "mongodb", "Your project should list "mongodb" as a dependency"); }, xhr => { throw new Error(xhr.statusText); })' - text: Mongodb properly required including the ObjectId - testString: 'getUserInput => $.get(getUserInput(''url'')+ ''/_api/server.js'') .then(data => { assert.match(data, /require.*("|'')mongodb("|'')/gi, ''You should have required mongodb''); assert.match(data, /new ObjectID.*id/gi, ''Even though the block is commented out, you should use new ObjectID(id) for when we add the database''); }, xhr => { throw new Error(xhr.statusText); })' + testString: 'getUserInput => $.get(getUserInput("url")+ "/_api/server.js") .then(data => { assert.match(data, /require.*("|")mongodb("|")/gi, "You should have required mongodb"); assert.match(data, /new ObjectID.*id/gi, "Even though the block is commented out, you should use new ObjectID(id) for when we add the database"); }, xhr => { throw new Error(xhr.statusText); })' ``` diff --git a/curriculum/challenges/english/06-information-security-and-quality-assurance/advanced-node-and-express/set-up-a-template-engine.english.md b/curriculum/challenges/english/06-information-security-and-quality-assurance/advanced-node-and-express/set-up-a-template-engine.english.md index 477f09de83..6d7a524a6a 100644 --- a/curriculum/challenges/english/06-information-security-and-quality-assurance/advanced-node-and-express/set-up-a-template-engine.english.md +++ b/curriculum/challenges/english/06-information-security-and-quality-assurance/advanced-node-and-express/set-up-a-template-engine.english.md @@ -25,11 +25,11 @@ If all went as planned, you should refresh your apps home page and see a small m ```yml tests: - text: Pug is a dependency - testString: 'getUserInput => $.get(getUserInput(''url'')+ ''/_api/package.json'') .then(data => { var packJson = JSON.parse(data); assert.property(packJson.dependencies, ''pug'', ''Your project should list "pug" as a dependency''); }, xhr => { throw new Error(xhr.statusText); })' + testString: 'getUserInput => $.get(getUserInput("url")+ "/_api/package.json") .then(data => { var packJson = JSON.parse(data); assert.property(packJson.dependencies, "pug", "Your project should list "pug" as a dependency"); }, xhr => { throw new Error(xhr.statusText); })' - text: View engine is Pug - testString: 'getUserInput => $.get(getUserInput(''url'')+ ''/_api/server.js'') .then(data => { assert.match(data, /(''|")view engine(''|"),( |)(''|")pug(''|")/gi, ''Your project should set Pug as a view engine''); }, xhr => { throw new Error(xhr.statusText); })' + testString: 'getUserInput => $.get(getUserInput("url")+ "/_api/server.js") .then(data => { assert.match(data, /("|")view engine("|"),( |)("|")pug("|")/gi, "Your project should set Pug as a view engine"); }, xhr => { throw new Error(xhr.statusText); })' - text: Pug is working - testString: 'getUserInput => $.get(getUserInput(''url'')+ ''/'') .then(data => { assert.match(data, /pug-success-message/gi, ''Your projects home page should now be rendered by pug with the projects .pug file unaltered''); }, xhr => { throw new Error(xhr.statusText); })' + testString: 'getUserInput => $.get(getUserInput("url")+ "/") .then(data => { assert.match(data, /pug-success-message/gi, "Your projects home page should now be rendered by pug with the projects .pug file unaltered"); }, xhr => { throw new Error(xhr.statusText); })' ``` diff --git a/curriculum/challenges/english/06-information-security-and-quality-assurance/advanced-node-and-express/set-up-passport.english.md b/curriculum/challenges/english/06-information-security-and-quality-assurance/advanced-node-and-express/set-up-passport.english.md index 9a6d9a41c5..fe82a287ba 100644 --- a/curriculum/challenges/english/06-information-security-and-quality-assurance/advanced-node-and-express/set-up-passport.english.md +++ b/curriculum/challenges/english/06-information-security-and-quality-assurance/advanced-node-and-express/set-up-passport.english.md @@ -32,13 +32,13 @@ Submit your page when you think you've got it right. If you're running into erro ```yml tests: - text: Passort and Express-session are dependencies - testString: 'getUserInput => $.get(getUserInput(''url'')+ ''/_api/package.json'') .then(data => { var packJson = JSON.parse(data); assert.property(packJson.dependencies, ''passport'', ''Your project should list "passport" as a dependency''); assert.property(packJson.dependencies, ''express-session'', ''Your project should list "express-session" as a dependency''); }, xhr => { throw new Error(xhr.statusText); })' + testString: 'getUserInput => $.get(getUserInput("url")+ "/_api/package.json") .then(data => { var packJson = JSON.parse(data); assert.property(packJson.dependencies, "passport", "Your project should list "passport" as a dependency"); assert.property(packJson.dependencies, "express-session", "Your project should list "express-session" as a dependency"); }, xhr => { throw new Error(xhr.statusText); })' - text: Dependencies correctly required - testString: 'getUserInput => $.get(getUserInput(''url'')+ ''/_api/server.js'') .then(data => { assert.match(data, /require.*("|'')passport("|'')/gi, ''You should have required passport''); assert.match(data, /require.*("|'')express-session("|'')/gi, ''You should have required express-session''); }, xhr => { throw new Error(xhr.statusText); })' + testString: 'getUserInput => $.get(getUserInput("url")+ "/_api/server.js") .then(data => { assert.match(data, /require.*("|")passport("|")/gi, "You should have required passport"); assert.match(data, /require.*("|")express-session("|")/gi, "You should have required express-session"); }, xhr => { throw new Error(xhr.statusText); })' - text: Express app uses new dependencies - testString: 'getUserInput => $.get(getUserInput(''url'')+ ''/_api/server.js'') .then(data => { assert.match(data, /passport.initialize/gi, ''Your express app should use "passport.initialize()"''); assert.match(data, /passport.session/gi, ''Your express app should use "passport.session()"''); }, xhr => { throw new Error(xhr.statusText); })' + testString: 'getUserInput => $.get(getUserInput("url")+ "/_api/server.js") .then(data => { assert.match(data, /passport.initialize/gi, "Your express app should use "passport.initialize()""); assert.match(data, /passport.session/gi, "Your express app should use "passport.session()""); }, xhr => { throw new Error(xhr.statusText); })' - text: Session and session secret correctly set up - testString: 'getUserInput => $.get(getUserInput(''url'')+ ''/_api/server.js'') .then(data => { assert.match(data, /secret:( |)process.env.SESSION_SECRET/gi, ''Your express app should have express-session set up with your secret as process.env.SESSION_SECRET''); }, xhr => { throw new Error(xhr.statusText); })' + testString: 'getUserInput => $.get(getUserInput("url")+ "/_api/server.js") .then(data => { assert.match(data, /secret:( |)process.env.SESSION_SECRET/gi, "Your express app should have express-session set up with your secret as process.env.SESSION_SECRET"); }, xhr => { throw new Error(xhr.statusText); })' ``` diff --git a/curriculum/challenges/english/06-information-security-and-quality-assurance/advanced-node-and-express/set-up-the-environment.english.md b/curriculum/challenges/english/06-information-security-and-quality-assurance/advanced-node-and-express/set-up-the-environment.english.md index f7b0695c26..68d33390ee 100644 --- a/curriculum/challenges/english/06-information-security-and-quality-assurance/advanced-node-and-express/set-up-the-environment.english.md +++ b/curriculum/challenges/english/06-information-security-and-quality-assurance/advanced-node-and-express/set-up-the-environment.english.md @@ -30,13 +30,13 @@ Submit your page when you think you've got it right. ```yml tests: - text: Socket.IO is a dependency - testString: 'getUserInput => $.get(getUserInput(''url'')+ ''/_api/package.json'') .then(data => { var packJson = JSON.parse(data); assert.property(packJson.dependencies, ''socket.io'', ''Your project should list "socket.io" as a dependency''); }, xhr => { throw new Error(xhr.statusText); })' + testString: 'getUserInput => $.get(getUserInput("url")+ "/_api/package.json") .then(data => { var packJson = JSON.parse(data); assert.property(packJson.dependencies, "socket.io", "Your project should list "socket.io" as a dependency"); }, xhr => { throw new Error(xhr.statusText); })' - text: Socket.IO has been properly required and instanciated - testString: 'getUserInput => $.get(getUserInput(''url'')+ ''/_api/server.js'').then(data => {assert.match(data, /io.*=.*require.*(''|")socket.io(''|").*http/gi, ''You should correctly require and instantiate socket.io as io.'');}, xhr => { throw new Error(xhr.statusText); })' + testString: 'getUserInput => $.get(getUserInput("url")+ "/_api/server.js").then(data => {assert.match(data, /io.*=.*require.*("|")socket.io("|").*http/gi, "You should correctly require and instantiate socket.io as io.");}, xhr => { throw new Error(xhr.statusText); })' - text: Socket.IO should be listening for connections - testString: 'getUserInput => $.get(getUserInput(''url'')+ ''/_api/server.js'') .then(data => { assert.match(data, /io.on.*(''|")connection(''|").*socket/gi, ''io should listen for "connection" and socket should be the 2nd arguments variable''); }, xhr => { throw new Error(xhr.statusText); })' + testString: 'getUserInput => $.get(getUserInput("url")+ "/_api/server.js") .then(data => { assert.match(data, /io.on.*("|")connection("|").*socket/gi, "io should listen for "connection" and socket should be the 2nd arguments variable"); }, xhr => { throw new Error(xhr.statusText); })' - text: Your client should connect to your server - testString: 'getUserInput => $.get(getUserInput(''url'')+ ''/public/client.js'') .then(data => { assert.match(data, /socket.*=.*io/gi, ''Your client should be connection to server with the connection defined as socket''); }, xhr => { throw new Error(xhr.statusText); })' + testString: 'getUserInput => $.get(getUserInput("url")+ "/public/client.js") .then(data => { assert.match(data, /socket.*=.*io/gi, "Your client should be connection to server with the connection defined as socket"); }, xhr => { throw new Error(xhr.statusText); })' ``` diff --git a/curriculum/challenges/english/06-information-security-and-quality-assurance/advanced-node-and-express/use-a-template-engines-powers.english.md b/curriculum/challenges/english/06-information-security-and-quality-assurance/advanced-node-and-express/use-a-template-engines-powers.english.md index ad5d3fb70c..3fee4c4d4a 100644 --- a/curriculum/challenges/english/06-information-security-and-quality-assurance/advanced-node-and-express/use-a-template-engines-powers.english.md +++ b/curriculum/challenges/english/06-information-security-and-quality-assurance/advanced-node-and-express/use-a-template-engines-powers.english.md @@ -27,7 +27,7 @@ Now refresh your page and you should see those values rendered in your view in t ```yml tests: - text: Pug render variables correct - testString: 'getUserInput => $.get(getUserInput(''url'')+ ''/'') .then(data => { assert.match(data, /pug-variable("|'')>Please login/gi, ''Your projects home page should now be rendered by pug with the projects .pug file unaltered''); }, xhr => { throw new Error(xhr.statusText); })' + testString: 'getUserInput => $.get(getUserInput("url")+ "/") .then(data => { assert.match(data, /pug-variable("|")>Please login/gi, "Your projects home page should now be rendered by pug with the projects .pug file unaltered"); }, xhr => { throw new Error(xhr.statusText); })' ``` diff --git a/curriculum/challenges/english/06-information-security-and-quality-assurance/information-security-and-quality-assurance-projects/anonymous-message-board.english.md b/curriculum/challenges/english/06-information-security-and-quality-assurance/information-security-and-quality-assurance-projects/anonymous-message-board.english.md index 222481c6c6..96c63bdb96 100644 --- a/curriculum/challenges/english/06-information-security-and-quality-assurance/information-security-and-quality-assurance-projects/anonymous-message-board.english.md +++ b/curriculum/challenges/english/06-information-security-and-quality-assurance/information-security-and-quality-assurance-projects/anonymous-message-board.english.md @@ -23,29 +23,29 @@ Start this project on Glitch using $.get(getUserInput(''url'') + ''/_api/app-info'').then(data => { assert.include(data.appStack, ''hsts''); assert.property(data.headers, ''strict-transport-security''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/app-info").then(data => { assert.include(data.appStack, "hsts"); assert.property(data.headers, "strict-transport-security"); }, xhr => { throw new Error(xhr.responseText); })' - text: maxAge should be equal to 7776000 ms (90 days) - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/app-info'').then(data => { assert.match(data.headers[''strict-transport-security''], /^max-age=777600000;?/); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/app-info").then(data => { assert.match(data.headers["strict-transport-security"], /^max-age=777600000;?/); }, xhr => { throw new Error(xhr.responseText); })' ``` diff --git a/curriculum/challenges/english/06-information-security-and-quality-assurance/information-security-with-helmetjs/avoid-inferring-the-response-mime-type-with-helmet.nosniff.english.md b/curriculum/challenges/english/06-information-security-and-quality-assurance/information-security-with-helmetjs/avoid-inferring-the-response-mime-type-with-helmet.nosniff.english.md index b7654f686a..d004b97c26 100644 --- a/curriculum/challenges/english/06-information-security-and-quality-assurance/information-security-with-helmetjs/avoid-inferring-the-response-mime-type-with-helmet.nosniff.english.md +++ b/curriculum/challenges/english/06-information-security-and-quality-assurance/information-security-with-helmetjs/avoid-inferring-the-response-mime-type-with-helmet.nosniff.english.md @@ -21,7 +21,7 @@ Browsers can use content or MIME sniffing to adapt to different datatypes coming ```yml tests: - text: helmet.noSniff() middleware should be mounted correctly - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/app-info'').then(data => { assert.include(data.appStack, ''nosniff''); assert.equal(data.headers[''x-content-type-options''], ''nosniff''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/app-info").then(data => { assert.include(data.appStack, "nosniff"); assert.equal(data.headers["x-content-type-options"], "nosniff"); }, xhr => { throw new Error(xhr.responseText); })' ``` diff --git a/curriculum/challenges/english/06-information-security-and-quality-assurance/information-security-with-helmetjs/disable-client-side-caching-with-helmet.nocache.english.md b/curriculum/challenges/english/06-information-security-and-quality-assurance/information-security-with-helmetjs/disable-client-side-caching-with-helmet.nocache.english.md index 9ffd874f57..7fab1b1785 100644 --- a/curriculum/challenges/english/06-information-security-and-quality-assurance/information-security-with-helmetjs/disable-client-side-caching-with-helmet.nocache.english.md +++ b/curriculum/challenges/english/06-information-security-and-quality-assurance/information-security-with-helmetjs/disable-client-side-caching-with-helmet.nocache.english.md @@ -21,7 +21,7 @@ If you are releasing an update for your website, and you want the users to alway ```yml tests: - text: helmet.noCache() middleware should be mounted correctly - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/app-info'').then(data => { assert.include(data.appStack, ''nocache''); assert.equal(data.headers[''cache-control''], ''no-store, no-cache, must-revalidate, proxy-revalidate''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/app-info").then(data => { assert.include(data.appStack, "nocache"); assert.equal(data.headers["cache-control"], "no-store, no-cache, must-revalidate, proxy-revalidate"); }, xhr => { throw new Error(xhr.responseText); })' ``` diff --git a/curriculum/challenges/english/06-information-security-and-quality-assurance/information-security-with-helmetjs/disable-dns-prefetching-with-helmet.dnsprefetchcontrol.english.md b/curriculum/challenges/english/06-information-security-and-quality-assurance/information-security-with-helmetjs/disable-dns-prefetching-with-helmet.dnsprefetchcontrol.english.md index 5eac630330..03c6627124 100644 --- a/curriculum/challenges/english/06-information-security-and-quality-assurance/information-security-with-helmetjs/disable-dns-prefetching-with-helmet.dnsprefetchcontrol.english.md +++ b/curriculum/challenges/english/06-information-security-and-quality-assurance/information-security-with-helmetjs/disable-dns-prefetching-with-helmet.dnsprefetchcontrol.english.md @@ -21,7 +21,7 @@ To improve performance, most browsers prefetch DNS records for the links in a pa ```yml tests: - text: helmet.dnsPrefetchControl() middleware should be mounted correctly - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/app-info'').then(data => { assert.include(data.appStack, ''dnsPrefetchControl''); assert.equal(data.headers[''x-dns-prefetch-control''], ''off''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/app-info").then(data => { assert.include(data.appStack, "dnsPrefetchControl"); assert.equal(data.headers["x-dns-prefetch-control"], "off"); }, xhr => { throw new Error(xhr.responseText); })' ``` diff --git a/curriculum/challenges/english/06-information-security-and-quality-assurance/information-security-with-helmetjs/hash-and-compare-passwords-asynchronously.english.md b/curriculum/challenges/english/06-information-security-and-quality-assurance/information-security-with-helmetjs/hash-and-compare-passwords-asynchronously.english.md index 2d0697049d..f0da866583 100644 --- a/curriculum/challenges/english/06-information-security-and-quality-assurance/information-security-with-helmetjs/hash-and-compare-passwords-asynchronously.english.md +++ b/curriculum/challenges/english/06-information-security-and-quality-assurance/information-security-with-helmetjs/hash-and-compare-passwords-asynchronously.english.md @@ -30,7 +30,7 @@ Submit your page when you think you've got it right. ```yml tests: - text: Async hash generated and correctly compared - testString: 'getUserInput => $.get(getUserInput(''url'')+ ''/_api/server.js'') .then(data => { assert.match(data, /START_ASYNC[^]*bcrypt.hash.*myPlaintextPassword( |),( |)saltRounds( |),( |).*err( |),( |)hash[^]*END_ASYNC/gi, ''You should call bcrypt.hash on myPlaintextPassword and saltRounds and handle err and hash as a result in the callback''); assert.match(data, /START_ASYNC[^]*bcrypt.hash[^]*bcrypt.compare.*myPlaintextPassword( |),( |)hash( |),( |).*err( |),( |)res[^]*}[^]*}[^]*END_ASYNC/gi, ''Nested within the hash function should be the compare function comparing myPlaintextPassword to hash''); }, xhr => { throw new Error(xhr.statusText); })' + testString: 'getUserInput => $.get(getUserInput("url")+ "/_api/server.js") .then(data => { assert.match(data, /START_ASYNC[^]*bcrypt.hash.*myPlaintextPassword( |),( |)saltRounds( |),( |).*err( |),( |)hash[^]*END_ASYNC/gi, "You should call bcrypt.hash on myPlaintextPassword and saltRounds and handle err and hash as a result in the callback"); assert.match(data, /START_ASYNC[^]*bcrypt.hash[^]*bcrypt.compare.*myPlaintextPassword( |),( |)hash( |),( |).*err( |),( |)res[^]*}[^]*}[^]*END_ASYNC/gi, "Nested within the hash function should be the compare function comparing myPlaintextPassword to hash"); }, xhr => { throw new Error(xhr.statusText); })' ``` diff --git a/curriculum/challenges/english/06-information-security-and-quality-assurance/information-security-with-helmetjs/hash-and-compare-passwords-synchronously.english.md b/curriculum/challenges/english/06-information-security-and-quality-assurance/information-security-with-helmetjs/hash-and-compare-passwords-synchronously.english.md index ed5408ead7..ff2908992c 100644 --- a/curriculum/challenges/english/06-information-security-and-quality-assurance/information-security-with-helmetjs/hash-and-compare-passwords-synchronously.english.md +++ b/curriculum/challenges/english/06-information-security-and-quality-assurance/information-security-with-helmetjs/hash-and-compare-passwords-synchronously.english.md @@ -24,7 +24,7 @@ Submit your page when you think you've got it right. If you ran into errors duri ```yml tests: - text: Sync hash generated and correctly compared - testString: 'getUserInput => $.get(getUserInput(''url'')+ ''/_api/server.js'') .then(data => { assert.match(data, /START_SYNC[^]*hash.*=.*bcrypt.hashSync.*myPlaintextPassword( |),( |)saltRounds[^]*END_SYNC/gi, ''You should call bcrypt.hashSync on myPlaintextPassword with saltRounds''); assert.match(data, /START_SYNC[^]*result.*=.*bcrypt.compareSync.*myPlaintextPassword( |),( |)hash[^]*END_SYNC/gi, ''You should call bcrypt.compareSync on myPlaintextPassword with the hash generated in the last line''); }, xhr => { throw new Error(xhr.statusText); })' + testString: 'getUserInput => $.get(getUserInput("url")+ "/_api/server.js") .then(data => { assert.match(data, /START_SYNC[^]*hash.*=.*bcrypt.hashSync.*myPlaintextPassword( |),( |)saltRounds[^]*END_SYNC/gi, "You should call bcrypt.hashSync on myPlaintextPassword with saltRounds"); assert.match(data, /START_SYNC[^]*result.*=.*bcrypt.compareSync.*myPlaintextPassword( |),( |)hash[^]*END_SYNC/gi, "You should call bcrypt.compareSync on myPlaintextPassword with the hash generated in the last line"); }, xhr => { throw new Error(xhr.statusText); })' ``` diff --git a/curriculum/challenges/english/06-information-security-and-quality-assurance/information-security-with-helmetjs/hide-potentially-dangerous-information-using-helmet.hidepoweredby.english.md b/curriculum/challenges/english/06-information-security-and-quality-assurance/information-security-with-helmetjs/hide-potentially-dangerous-information-using-helmet.hidepoweredby.english.md index 56809b94a6..b5f54bec67 100644 --- a/curriculum/challenges/english/06-information-security-and-quality-assurance/information-security-with-helmetjs/hide-potentially-dangerous-information-using-helmet.hidepoweredby.english.md +++ b/curriculum/challenges/english/06-information-security-and-quality-assurance/information-security-with-helmetjs/hide-potentially-dangerous-information-using-helmet.hidepoweredby.english.md @@ -21,7 +21,7 @@ Hackers can exploit known vulnerabilities in Express/Node if they see that your ```yml tests: - text: helmet.hidePoweredBy() middleware should be mounted correctly - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/app-info'').then(data => { assert.include(data.appStack, ''hidePoweredBy''); assert.notEqual(data.headers[''x-powered-by''], ''Express'')}, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/app-info").then(data => { assert.include(data.appStack, "hidePoweredBy"); assert.notEqual(data.headers["x-powered-by"], "Express")}, xhr => { throw new Error(xhr.responseText); })' ``` diff --git a/curriculum/challenges/english/06-information-security-and-quality-assurance/information-security-with-helmetjs/install-and-require-helmet.english.md b/curriculum/challenges/english/06-information-security-and-quality-assurance/information-security-with-helmetjs/install-and-require-helmet.english.md index 4c3e84a134..4e9ccc60b1 100644 --- a/curriculum/challenges/english/06-information-security-and-quality-assurance/information-security-with-helmetjs/install-and-require-helmet.english.md +++ b/curriculum/challenges/english/06-information-security-and-quality-assurance/information-security-with-helmetjs/install-and-require-helmet.english.md @@ -21,7 +21,7 @@ Helmet helps you secure your Express apps by setting various HTTP headers. Insta ```yml tests: - text: '"helmet" dependency should be in package.json' - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/package.json'').then(data => { var packJson = JSON.parse(data); assert.property(packJson.dependencies, ''helmet''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/package.json").then(data => { var packJson = JSON.parse(data); assert.property(packJson.dependencies, "helmet"); }, xhr => { throw new Error(xhr.responseText); })' ``` diff --git a/curriculum/challenges/english/06-information-security-and-quality-assurance/information-security-with-helmetjs/mitigate-the-risk-of-clickjacking-with-helmet.frameguard.english.md b/curriculum/challenges/english/06-information-security-and-quality-assurance/information-security-with-helmetjs/mitigate-the-risk-of-clickjacking-with-helmet.frameguard.english.md index 3b7310a35b..362138ee9b 100644 --- a/curriculum/challenges/english/06-information-security-and-quality-assurance/information-security-with-helmetjs/mitigate-the-risk-of-clickjacking-with-helmet.frameguard.english.md +++ b/curriculum/challenges/english/06-information-security-and-quality-assurance/information-security-with-helmetjs/mitigate-the-risk-of-clickjacking-with-helmet.frameguard.english.md @@ -22,9 +22,9 @@ We don’t need our app to be framed. You should use helmet.frameguard() $.get(getUserInput(''url'') + ''/_api/app-info'').then(data => { assert.include(data.appStack, ''frameguard'', ''helmet.frameguard() middleware is not mounted correctly''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/app-info").then(data => { assert.include(data.appStack, "frameguard", "helmet.frameguard() middleware is not mounted correctly"); }, xhr => { throw new Error(xhr.responseText); })' - text: helmet.frameguard() 'action' should be set to 'DENY' - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/app-info'').then(data => { assert.property(data.headers, ''x-frame-options''); assert.equal(data.headers[''x-frame-options''], ''DENY'');}, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/app-info").then(data => { assert.property(data.headers, "x-frame-options"); assert.equal(data.headers["x-frame-options"], "DENY");}, xhr => { throw new Error(xhr.responseText); })' ``` diff --git a/curriculum/challenges/english/06-information-security-and-quality-assurance/information-security-with-helmetjs/mitigate-the-risk-of-cross-site-scripting-xss-attacks-with-helmet.xssfilter.english.md b/curriculum/challenges/english/06-information-security-and-quality-assurance/information-security-with-helmetjs/mitigate-the-risk-of-cross-site-scripting-xss-attacks-with-helmet.xssfilter.english.md index ec3a953c0b..f1c7b600e8 100644 --- a/curriculum/challenges/english/06-information-security-and-quality-assurance/information-security-with-helmetjs/mitigate-the-risk-of-cross-site-scripting-xss-attacks-with-helmet.xssfilter.english.md +++ b/curriculum/challenges/english/06-information-security-and-quality-assurance/information-security-with-helmetjs/mitigate-the-risk-of-cross-site-scripting-xss-attacks-with-helmet.xssfilter.english.md @@ -25,7 +25,7 @@ It still has limited support. ```yml tests: - text: helmet.xssFilter() middleware should be mounted correctly - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/app-info'').then(data => { assert.include(data.appStack, ''xXssProtection''); assert.property(data.headers, ''x-xss-protection''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/app-info").then(data => { assert.include(data.appStack, "xXssProtection"); assert.property(data.headers, "x-xss-protection"); }, xhr => { throw new Error(xhr.responseText); })' ``` diff --git a/curriculum/challenges/english/06-information-security-and-quality-assurance/information-security-with-helmetjs/prevent-ie-from-opening-untrusted-html-with-helmet.ienoopen.english.md b/curriculum/challenges/english/06-information-security-and-quality-assurance/information-security-with-helmetjs/prevent-ie-from-opening-untrusted-html-with-helmet.ienoopen.english.md index c266a779ab..8369bd5b53 100644 --- a/curriculum/challenges/english/06-information-security-and-quality-assurance/information-security-with-helmetjs/prevent-ie-from-opening-untrusted-html-with-helmet.ienoopen.english.md +++ b/curriculum/challenges/english/06-information-security-and-quality-assurance/information-security-with-helmetjs/prevent-ie-from-opening-untrusted-html-with-helmet.ienoopen.english.md @@ -21,7 +21,7 @@ Some web applications will serve untrusted HTML for download. Some versions of I ```yml tests: - text: helmet.ieNoOpen() middleware should be mounted correctly - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/app-info'').then(data => { assert.include(data.appStack, ''ienoopen''); assert.equal(data.headers[''x-download-options''], ''noopen''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/app-info").then(data => { assert.include(data.appStack, "ienoopen"); assert.equal(data.headers["x-download-options"], "noopen"); }, xhr => { throw new Error(xhr.responseText); })' ``` diff --git a/curriculum/challenges/english/06-information-security-and-quality-assurance/information-security-with-helmetjs/set-a-content-security-policy-with-helmet.contentsecuritypolicy.english.md b/curriculum/challenges/english/06-information-security-and-quality-assurance/information-security-with-helmetjs/set-a-content-security-policy-with-helmet.contentsecuritypolicy.english.md index f4c56fc65c..e1a57230b8 100644 --- a/curriculum/challenges/english/06-information-security-and-quality-assurance/information-security-with-helmetjs/set-a-content-security-policy-with-helmet.contentsecuritypolicy.english.md +++ b/curriculum/challenges/english/06-information-security-and-quality-assurance/information-security-with-helmetjs/set-a-content-security-policy-with-helmet.contentsecuritypolicy.english.md @@ -23,9 +23,9 @@ Hint: in the "'self'" keyword, the single quotes are part of the keyword itself, ```yml tests: - text: helmet.csp() middleware should be mounted correctly - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/app-info'').then(data => { assert.include(data.appStack, ''csp''); }, xhr => { throw new Error(xhr.responseText); })' - - text: 'Your csp config is not correct. defaultSrc should be ["''self''"] and scriptSrc should be ["''self''", ''trusted-cdn.com'']' - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/app-info'').then(data => { var cspHeader = Object.keys(data.headers).filter(function(k){ return k === ''content-security-policy'' || k === ''x-webkit-csp'' || k === ''x-content-security-policy'' })[0]; assert.equal(data.headers[cspHeader], "default-src ''self''; script-src ''self'' trusted-cdn.com"); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/app-info").then(data => { assert.include(data.appStack, "csp"); }, xhr => { throw new Error(xhr.responseText); })' + - text: 'Your csp config is not correct. defaultSrc should be [""self""] and scriptSrc should be [""self"", "trusted-cdn.com"]' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/app-info").then(data => { var cspHeader = Object.keys(data.headers).filter(function(k){ return k === "content-security-policy" || k === "x-webkit-csp" || k === "x-content-security-policy" })[0]; assert.equal(data.headers[cspHeader], "default-src "self"; script-src "self" trusted-cdn.com"); }, xhr => { throw new Error(xhr.responseText); })' ``` diff --git a/curriculum/challenges/english/06-information-security-and-quality-assurance/information-security-with-helmetjs/understand-bcrypt-hashes.english.md b/curriculum/challenges/english/06-information-security-and-quality-assurance/information-security-with-helmetjs/understand-bcrypt-hashes.english.md index eeb4e24eb2..afcf6398e5 100644 --- a/curriculum/challenges/english/06-information-security-and-quality-assurance/information-security-with-helmetjs/understand-bcrypt-hashes.english.md +++ b/curriculum/challenges/english/06-information-security-and-quality-assurance/information-security-with-helmetjs/understand-bcrypt-hashes.english.md @@ -24,9 +24,9 @@ Submit your page when you think you've got it right. ```yml tests: - text: BCyrpt is a dependency - testString: 'getUserInput => $.get(getUserInput(''url'')+ ''/_api/package.json'') .then(data => { var packJson = JSON.parse(data); assert.property(packJson.dependencies, ''bcrypt'', ''Your project should list "bcrypt" as a dependency''); }, xhr => { throw new Error(xhr.statusText); })' + testString: 'getUserInput => $.get(getUserInput("url")+ "/_api/package.json") .then(data => { var packJson = JSON.parse(data); assert.property(packJson.dependencies, "bcrypt", "Your project should list "bcrypt" as a dependency"); }, xhr => { throw new Error(xhr.statusText); })' - text: BCrypt has been properly required - testString: 'getUserInput => $.get(getUserInput(''url'')+ ''/_api/server.js'').then(data => {assert.match(data, /bcrypt.*=.*require.*(''|")bcrypt(''|")/gi, ''You should correctly require and instantiate socket.io as io.'');}, xhr => { throw new Error(xhr.statusText); })' + testString: 'getUserInput => $.get(getUserInput("url")+ "/_api/server.js").then(data => {assert.match(data, /bcrypt.*=.*require.*("|")bcrypt("|")/gi, "You should correctly require and instantiate socket.io as io.");}, xhr => { throw new Error(xhr.statusText); })' ``` diff --git a/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/assert-deep-equality-with-.deepequal-and-.notdeepequal.english.md b/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/assert-deep-equality-with-.deepequal-and-.notdeepequal.english.md index e246b7aa9e..0ab874ed53 100644 --- a/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/assert-deep-equality-with-.deepequal-and-.notdeepequal.english.md +++ b/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/assert-deep-equality-with-.deepequal-and-.notdeepequal.english.md @@ -22,11 +22,11 @@ As a reminder, this project is being built upon the following starter project on ```yml tests: - text: All tests should pass - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=6'').then(data => {assert.equal(data.state,''passed''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=6").then(data => {assert.equal(data.state,"passed"); }, xhr => { throw new Error(xhr.responseText); })' - text: Choose the right assertion - deepEqual vs. notDeepEqual - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=6'').then(data => { assert.equal(data.assertions[0].method, ''deepEqual'', ''The order of the keys does not matter''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=6").then(data => { assert.equal(data.assertions[0].method, "deepEqual", "The order of the keys does not matter"); }, xhr => { throw new Error(xhr.responseText); })' - text: Choose the right assertion - deepEqual vs. notDeepEqual - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=6'').then(data => { assert.equal(data.assertions[1].method, ''notDeepEqual'', ''The position of elements within an array does matter''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=6").then(data => { assert.equal(data.assertions[1].method, "notDeepEqual", "The position of elements within an array does matter"); }, xhr => { throw new Error(xhr.responseText); })' ``` diff --git a/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/compare-the-properties-of-two-elements.english.md b/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/compare-the-properties-of-two-elements.english.md index 9b9f3e2ea7..b424780a56 100644 --- a/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/compare-the-properties-of-two-elements.english.md +++ b/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/compare-the-properties-of-two-elements.english.md @@ -21,15 +21,15 @@ As a reminder, this project is being built upon the following starter project on ```yml tests: - text: All tests should pass - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=7'').then(data => {assert.equal(data.state,''passed''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=7").then(data => {assert.equal(data.state,"passed"); }, xhr => { throw new Error(xhr.responseText); })' - text: Choose the right assertion - isAbove vs. isAtMost - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=7'').then(data => { assert.equal(data.assertions[0].method, ''isAtMost'', ''5 is at most (<=) 5''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=7").then(data => { assert.equal(data.assertions[0].method, "isAtMost", "5 is at most (<=) 5"); }, xhr => { throw new Error(xhr.responseText); })' - text: Choose the right assertion - isAbove vs. isAtMost - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=7'').then(data => { assert.equal(data.assertions[1].method, ''isAbove'', ''1 is greater than 0''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=7").then(data => { assert.equal(data.assertions[1].method, "isAbove", "1 is greater than 0"); }, xhr => { throw new Error(xhr.responseText); })' - text: Choose the right assertion - isAbove vs. isAtMost - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=7'').then(data => { assert.equal(data.assertions[2].method, ''isAbove'', ''Math.PI = 3.14159265 is greater than 3''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=7").then(data => { assert.equal(data.assertions[2].method, "isAbove", "Math.PI = 3.14159265 is greater than 3"); }, xhr => { throw new Error(xhr.responseText); })' - text: Choose the right assertion - isAbove vs. isAtMost - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=7'').then(data => { assert.equal(data.assertions[3].method, ''isAtMost'', ''1 - Math.random() is > 0 and <= 1. It is atMost 1 !''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=7").then(data => { assert.equal(data.assertions[3].method, "isAtMost", "1 - Math.random() is > 0 and <= 1. It is atMost 1 !"); }, xhr => { throw new Error(xhr.responseText); })' ``` diff --git a/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/learn-how-javascript-assertions-work.english.md b/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/learn-how-javascript-assertions-work.english.md index 1b62b6c8fe..611b4063da 100644 --- a/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/learn-how-javascript-assertions-work.english.md +++ b/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/learn-how-javascript-assertions-work.english.md @@ -21,11 +21,11 @@ Use assert.isNull() or assert.isNotNull() to make the tests pass. ```yml tests: - text: All tests should pass - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=0'').then(data => {assert.equal(data.state,''passed''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=0").then(data => {assert.equal(data.state,"passed"); }, xhr => { throw new Error(xhr.responseText); })' - text: Choose the right assertion - isNull vs. isNotNull - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=0'').then(data => { assert.equal(data.assertions[0].method, ''isNull'', ''Null is null''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=0").then(data => { assert.equal(data.assertions[0].method, "isNull", "Null is null"); }, xhr => { throw new Error(xhr.responseText); })' - text: Choose the right assertion - isNull vs. isNotNull - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=0'').then(data => { assert.equal(data.assertions[1].method, ''isNotNull'', ''1 is not null''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=0").then(data => { assert.equal(data.assertions[1].method, "isNotNull", "1 is not null"); }, xhr => { throw new Error(xhr.responseText); })' ``` diff --git a/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-on-an-api-response-using-chai-http-iii---put-method.english.md b/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-on-an-api-response-using-chai-http-iii---put-method.english.md index 323c8c8ac2..55cb3bc675 100644 --- a/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-on-an-api-response-using-chai-http-iii---put-method.english.md +++ b/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-on-an-api-response-using-chai-http-iii---put-method.english.md @@ -30,15 +30,15 @@ Follow the assertion order above, We rely on it. ```yml tests: - text: All tests should pass - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=functional&n=2'').then(data => { assert.equal(data.state,''passed''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=functional&n=2").then(data => { assert.equal(data.state,"passed"); }, xhr => { throw new Error(xhr.responseText); })' - text: You should test for 'res.status' to be 200 - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=functional&n=2'').then(data => { assert.equal(data.assertions[0].method, ''equal''); assert.equal(data.assertions[0].args[0], ''res.status''); assert.equal(data.assertions[0].args[1], ''200'');}, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=functional&n=2").then(data => { assert.equal(data.assertions[0].method, "equal"); assert.equal(data.assertions[0].args[0], "res.status"); assert.equal(data.assertions[0].args[1], "200");}, xhr => { throw new Error(xhr.responseText); })' - text: You should test for 'res.type' to be 'application/json' - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=functional&n=2'').then(data => { assert.equal(data.assertions[1].method, ''equal''); assert.equal(data.assertions[1].args[0], ''res.type''); assert.equal(data.assertions[1].args[1], ''\''application/json\'''');}, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=functional&n=2").then(data => { assert.equal(data.assertions[1].method, "equal"); assert.equal(data.assertions[1].args[0], "res.type"); assert.equal(data.assertions[1].args[1], "\"application/json\"");}, xhr => { throw new Error(xhr.responseText); })' - text: You should test for 'res.body.name' to be 'Cristoforo' - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=functional&n=2'').then(data => { assert.equal(data.assertions[2].method, ''equal''); assert.equal(data.assertions[2].args[0], ''res.body.name''); assert.equal(data.assertions[2].args[1], ''\''Cristoforo\'''');}, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=functional&n=2").then(data => { assert.equal(data.assertions[2].method, "equal"); assert.equal(data.assertions[2].args[0], "res.body.name"); assert.equal(data.assertions[2].args[1], "\"Cristoforo\"");}, xhr => { throw new Error(xhr.responseText); })' - text: You should test for 'res.body.surname' to be 'Colombo' - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=functional&n=2'').then(data => { assert.equal(data.assertions[3].method, ''equal''); assert.equal(data.assertions[3].args[0], ''res.body.surname''); assert.equal(data.assertions[3].args[1], ''\''Colombo\'''');}, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=functional&n=2").then(data => { assert.equal(data.assertions[3].method, "equal"); assert.equal(data.assertions[3].args[0], "res.body.surname"); assert.equal(data.assertions[3].args[1], "\"Colombo\"");}, xhr => { throw new Error(xhr.responseText); })' ``` diff --git a/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-on-an-api-response-using-chai-http-iv---put-method.english.md b/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-on-an-api-response-using-chai-http-iv---put-method.english.md index 592d36b3cb..60942fc3f3 100644 --- a/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-on-an-api-response-using-chai-http-iv---put-method.english.md +++ b/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-on-an-api-response-using-chai-http-iv---put-method.english.md @@ -24,15 +24,15 @@ Follow the assertion order above, We rely on it. ```yml tests: - text: All tests should pass - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=functional&n=3'').then(data => { assert.equal(data.state,''passed''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=functional&n=3").then(data => { assert.equal(data.state,"passed"); }, xhr => { throw new Error(xhr.responseText); })' - text: You should test for 'res.status' to be 200 - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=functional&n=3'').then(data => { assert.equal(data.assertions[0].method, ''equal''); assert.equal(data.assertions[0].args[0], ''res.status''); assert.equal(data.assertions[0].args[1], ''200'');}, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=functional&n=3").then(data => { assert.equal(data.assertions[0].method, "equal"); assert.equal(data.assertions[0].args[0], "res.status"); assert.equal(data.assertions[0].args[1], "200");}, xhr => { throw new Error(xhr.responseText); })' - text: You should test for 'res.type' to be 'application/json' - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=functional&n=3'').then(data => { assert.equal(data.assertions[1].method, ''equal''); assert.equal(data.assertions[1].args[0], ''res.type''); assert.equal(data.assertions[1].args[1], ''\''application/json\'''');}, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=functional&n=3").then(data => { assert.equal(data.assertions[1].method, "equal"); assert.equal(data.assertions[1].args[0], "res.type"); assert.equal(data.assertions[1].args[1], "\"application/json\"");}, xhr => { throw new Error(xhr.responseText); })' - text: You should test for 'res.body.name' to be 'Giovanni' - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=functional&n=3'').then(data => { assert.equal(data.assertions[2].method, ''equal''); assert.equal(data.assertions[2].args[0], ''res.body.name''); assert.equal(data.assertions[2].args[1], ''\''Giovanni\'''');}, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=functional&n=3").then(data => { assert.equal(data.assertions[2].method, "equal"); assert.equal(data.assertions[2].args[0], "res.body.name"); assert.equal(data.assertions[2].args[1], "\"Giovanni\"");}, xhr => { throw new Error(xhr.responseText); })' - text: You should test for 'res.body.surname' to be 'da Verrazzano' - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=functional&n=3'').then(data => { assert.equal(data.assertions[3].method, ''equal''); assert.equal(data.assertions[3].args[0], ''res.body.surname''); assert.equal(data.assertions[3].args[1], ''\''da Verrazzano\'''');}, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=functional&n=3").then(data => { assert.equal(data.assertions[3].method, "equal"); assert.equal(data.assertions[3].args[0], "res.body.surname"); assert.equal(data.assertions[3].args[1], "\"da Verrazzano\"");}, xhr => { throw new Error(xhr.responseText); })' ``` diff --git a/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-on-api-endpoints-using-chai-http-ii.english.md b/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-on-api-endpoints-using-chai-http-ii.english.md index ccfb7ee915..3efdb1da55 100644 --- a/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-on-api-endpoints-using-chai-http-ii.english.md +++ b/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-on-api-endpoints-using-chai-http-ii.english.md @@ -22,11 +22,11 @@ Send you name in the query appending ?name=, the endpoint with respon ```yml tests: - text: All tests should pass - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=functional&n=1'').then(data => { assert.equal(data.state,''passed''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=functional&n=1").then(data => { assert.equal(data.state,"passed"); }, xhr => { throw new Error(xhr.responseText); })' - text: You should test for 'res.status' == 200 - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=functional&n=1'').then(data => { assert.equal(data.assertions[0].method, ''equal''); assert.equal(data.assertions[0].args[0], ''res.status''); assert.equal(data.assertions[0].args[1], ''200'');}, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=functional&n=1").then(data => { assert.equal(data.assertions[0].method, "equal"); assert.equal(data.assertions[0].args[0], "res.status"); assert.equal(data.assertions[0].args[1], "200");}, xhr => { throw new Error(xhr.responseText); })' - text: You should test for 'res.text' == 'hello Guest' - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=functional&n=1'').then(data => { assert.equal(data.assertions[1].method, ''equal''); assert.equal(data.assertions[1].args[0], ''res.text''); assert.match(data.assertions[1].args[1], /hello [\w\d_-]/);}, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=functional&n=1").then(data => { assert.equal(data.assertions[1].method, "equal"); assert.equal(data.assertions[1].args[0], "res.text"); assert.match(data.assertions[1].args[1], /hello [\w\d_-]/);}, xhr => { throw new Error(xhr.responseText); })' ``` diff --git a/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-on-api-endpoints-using-chai-http.english.md b/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-on-api-endpoints-using-chai-http.english.md index d8e19d2c82..df63f8bc26 100644 --- a/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-on-api-endpoints-using-chai-http.english.md +++ b/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-on-api-endpoints-using-chai-http.english.md @@ -22,11 +22,11 @@ Don't send a name in the query, the endpoint with responds with 'hello Guest'. ```yml tests: - text: All tests should pass - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=functional&n=0'').then(data => { assert.equal(data.state,''passed''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=functional&n=0").then(data => { assert.equal(data.state,"passed"); }, xhr => { throw new Error(xhr.responseText); })' - text: You should test for 'res.status' == 200 - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=functional&n=0'').then(data => { assert.equal(data.assertions[0].method, ''equal''); assert.equal(data.assertions[0].args[0], ''res.status''); assert.equal(data.assertions[0].args[1], ''200'');}, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=functional&n=0").then(data => { assert.equal(data.assertions[0].method, "equal"); assert.equal(data.assertions[0].args[0], "res.status"); assert.equal(data.assertions[0].args[1], "200");}, xhr => { throw new Error(xhr.responseText); })' - text: You should test for 'res.text' == 'hello Guest' - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=functional&n=0'').then(data => { assert.equal(data.assertions[1].method, ''equal''); assert.equal(data.assertions[1].args[0], ''res.text''); assert.equal(data.assertions[1].args[1], ''\''hello Guest\'''');}, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=functional&n=0").then(data => { assert.equal(data.assertions[1].method, "equal"); assert.equal(data.assertions[1].args[0], "res.text"); assert.equal(data.assertions[1].args[1], "\"hello Guest\"");}, xhr => { throw new Error(xhr.responseText); })' ``` diff --git a/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-using-a-headless-browser-ii.english.md b/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-using-a-headless-browser-ii.english.md index 8212f8efcd..0a55d40623 100644 --- a/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-using-a-headless-browser-ii.english.md +++ b/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-using-a-headless-browser-ii.english.md @@ -22,15 +22,15 @@ Look at the code for directions. Follow the assertions order, We rely on it. ```yml tests: - text: All tests should pass - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=functional&n=5'').then(data => { assert.equal(data.state,''passed''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=functional&n=5").then(data => { assert.equal(data.state,"passed"); }, xhr => { throw new Error(xhr.responseText); })' - text: ' assert that the headless browser request succeeded' - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=functional&n=5'').then(data => { assert.equal(data.assertions[0].method, ''browser.success''); }, xhr => { throw new Error(xhr.responseText); })' - - text: 'assert that the text inside the element ''span#name'' is ''Amerigo''' - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=functional&n=5'').then(data => { assert.equal(data.assertions[1].method, ''browser.text''); assert.equal(data.assertions[1].args[0], ''\''span#name\''''); assert.equal(data.assertions[1].args[1], ''\''Amerigo\'''');}, xhr => { throw new Error(xhr.responseText); })' - - text: 'assert that the text inside the element ''span#surname'' is ''Vespucci''' - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=functional&n=5'').then(data => { assert.equal(data.assertions[2].method, ''browser.text''); assert.equal(data.assertions[2].args[0], ''\''span#surname\''''); assert.equal(data.assertions[2].args[1], ''\''Vespucci\'''');}, xhr => { throw new Error(xhr.responseText); })' - - text: 'assert that the element ''span#dates'' exist and its count is 1' - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=functional&n=5'').then(data => { assert.equal(data.assertions[3].method, ''browser.element''); assert.equal(data.assertions[3].args[0], ''\''span#dates\''''); assert.equal(data.assertions[3].args[1], 1);}, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=functional&n=5").then(data => { assert.equal(data.assertions[0].method, "browser.success"); }, xhr => { throw new Error(xhr.responseText); })' + - text: 'assert that the text inside the element "span#name" is "Amerigo"' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=functional&n=5").then(data => { assert.equal(data.assertions[1].method, "browser.text"); assert.equal(data.assertions[1].args[0], "\"span#name\""); assert.equal(data.assertions[1].args[1], "\"Amerigo\"");}, xhr => { throw new Error(xhr.responseText); })' + - text: 'assert that the text inside the element "span#surname" is "Vespucci"' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=functional&n=5").then(data => { assert.equal(data.assertions[2].method, "browser.text"); assert.equal(data.assertions[2].args[0], "\"span#surname\""); assert.equal(data.assertions[2].args[1], "\"Vespucci\"");}, xhr => { throw new Error(xhr.responseText); })' + - text: 'assert that the element "span#dates" exist and its count is 1' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=functional&n=5").then(data => { assert.equal(data.assertions[3].method, "browser.element"); assert.equal(data.assertions[3].args[0], "\"span#dates\""); assert.equal(data.assertions[3].args[1], 1);}, xhr => { throw new Error(xhr.responseText); })' ``` diff --git a/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-using-a-headless-browser.english.md b/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-using-a-headless-browser.english.md index be21ca00e9..32c345dbdd 100644 --- a/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-using-a-headless-browser.english.md +++ b/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-using-a-headless-browser.english.md @@ -24,15 +24,15 @@ Look at the examples in the code for the exercise directions Follow the assertio ```yml tests: - text: All tests should pass - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=functional&n=4'').then(data => { assert.equal(data.state,''passed''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=functional&n=4").then(data => { assert.equal(data.state,"passed"); }, xhr => { throw new Error(xhr.responseText); })' - text: assert that the headless browser request succeeded - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=functional&n=4'').then(data => { assert.equal(data.assertions[0].method, ''browser.success''); }, xhr => { throw new Error(xhr.responseText); })' - - text: 'assert that the text inside the element ''span#name'' is ''Cristoforo''' - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=functional&n=4'').then(data => { assert.equal(data.assertions[1].method, ''browser.text''); assert.equal(data.assertions[1].args[0], ''\''span#name\''''); assert.equal(data.assertions[1].args[1], ''\''Cristoforo\'''');}, xhr => { throw new Error(xhr.responseText); })' - - text: 'assert that the text inside the element ''span#surname'' is ''Colombo''' - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=functional&n=4'').then(data => { assert.equal(data.assertions[2].method, ''browser.text''); assert.equal(data.assertions[2].args[0], ''\''span#surname\''''); assert.equal(data.assertions[2].args[1], ''\''Colombo\'''');}, xhr => { throw new Error(xhr.responseText); })' - - text: 'assert that the element ''span#dates'' exist and its count is 1' - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=functional&n=4'').then(data => { assert.equal(data.assertions[3].method, ''browser.element''); assert.equal(data.assertions[3].args[0], ''\''span#dates\''''); assert.equal(data.assertions[3].args[1], 1);}, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=functional&n=4").then(data => { assert.equal(data.assertions[0].method, "browser.success"); }, xhr => { throw new Error(xhr.responseText); })' + - text: 'assert that the text inside the element "span#name" is "Cristoforo"' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=functional&n=4").then(data => { assert.equal(data.assertions[1].method, "browser.text"); assert.equal(data.assertions[1].args[0], "\"span#name\""); assert.equal(data.assertions[1].args[1], "\"Cristoforo\"");}, xhr => { throw new Error(xhr.responseText); })' + - text: 'assert that the text inside the element "span#surname" is "Colombo"' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=functional&n=4").then(data => { assert.equal(data.assertions[2].method, "browser.text"); assert.equal(data.assertions[2].args[0], "\"span#surname\""); assert.equal(data.assertions[2].args[1], "\"Colombo\"");}, xhr => { throw new Error(xhr.responseText); })' + - text: 'assert that the element "span#dates" exist and its count is 1' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=functional&n=4").then(data => { assert.equal(data.assertions[3].method, "browser.element"); assert.equal(data.assertions[3].args[0], "\"span#dates\""); assert.equal(data.assertions[3].args[1], 1);}, xhr => { throw new Error(xhr.responseText); })' ``` diff --git a/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/test-for-truthiness.english.md b/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/test-for-truthiness.english.md index 31dfaddae5..fca04e169c 100644 --- a/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/test-for-truthiness.english.md +++ b/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/test-for-truthiness.english.md @@ -23,13 +23,13 @@ Use assert.isTrue() or assert.isNotTrue() to make the tests pass. ```yml tests: - text: All tests should pass - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=3'').then(data => {assert.equal(data.state,''passed''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=3").then(data => {assert.equal(data.state,"passed"); }, xhr => { throw new Error(xhr.responseText); })' - text: Choose the right assertion - isTrue vs. isNotTrue - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=3'').then(data => { assert.equal(data.assertions[0].method, ''isTrue'', ''True is true''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=3").then(data => { assert.equal(data.assertions[0].method, "isTrue", "True is true"); }, xhr => { throw new Error(xhr.responseText); })' - text: Choose the right assertion - isTrue vs. isNotTrue - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=3'').then(data => { assert.equal(data.assertions[1].method, ''isTrue'', ''Double negation of a truthy value is true''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=3").then(data => { assert.equal(data.assertions[1].method, "isTrue", "Double negation of a truthy value is true"); }, xhr => { throw new Error(xhr.responseText); })' - text: Choose the right assertion - isTrue vs. isNotTrue - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=3'').then(data => { assert.equal(data.assertions[2].method, ''isNotTrue'', ''A truthy object is not true - neither is a false one''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=3").then(data => { assert.equal(data.assertions[2].method, "isNotTrue", "A truthy object is not true - neither is a false one"); }, xhr => { throw new Error(xhr.responseText); })' ``` diff --git a/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/test-if-a-string-contains-a-substring.english.md b/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/test-if-a-string-contains-a-substring.english.md index a61e17bb0a..d4ac586fc8 100644 --- a/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/test-if-a-string-contains-a-substring.english.md +++ b/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/test-if-a-string-contains-a-substring.english.md @@ -22,11 +22,11 @@ It asserts that the actual string contains the expected substring ```yml tests: - text: All tests should pass - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=13'').then(data => { assert.equal(data.state,''passed''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=13").then(data => { assert.equal(data.state,"passed"); }, xhr => { throw new Error(xhr.responseText); })' - text: Choose the right assertion - include vs. notInclude - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=13'').then(data => { assert.equal(data.assertions[0].method, ''include'', ''\''Arrow\'' contains \''row\''...''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=13").then(data => { assert.equal(data.assertions[0].method, "include", "\"Arrow\" contains \"row\"..."); }, xhr => { throw new Error(xhr.responseText); })' - text: Choose the right assertion - include vs. notInclude - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=13'').then(data => { assert.equal(data.assertions[1].method, ''notInclude'', ''... a \''dart\'' doesn\''t contain a \''queue\''''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=13").then(data => { assert.equal(data.assertions[1].method, "notInclude", "... a \"dart\" doesn\"t contain a \"queue\""); }, xhr => { throw new Error(xhr.responseText); })' ``` diff --git a/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/test-if-a-value-falls-within-a-specific-range.english.md b/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/test-if-a-value-falls-within-a-specific-range.english.md index 34b839ee78..65cbf49510 100644 --- a/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/test-if-a-value-falls-within-a-specific-range.english.md +++ b/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/test-if-a-value-falls-within-a-specific-range.english.md @@ -25,11 +25,11 @@ it should be less than 1 ```yml tests: - text: All tests should pass - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=9'').then(data => {assert.equal(data.state,''passed''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=9").then(data => {assert.equal(data.state,"passed"); }, xhr => { throw new Error(xhr.responseText); })' - text: 'Use approximately(actual, expected, range) - Chose the correct range' - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=9'').then(data => { assert.equal(data.assertions[0].method, ''approximately''); assert.equal(data.assertions[0].args[2], 0.5, ''weirdNumbers(0.5) is in the range (0.5, 1.5]. It\''s within 1 +/- 0.5''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=9").then(data => { assert.equal(data.assertions[0].method, "approximately"); assert.equal(data.assertions[0].args[2], 0.5, "weirdNumbers(0.5) is in the range (0.5, 1.5]. It\"s within 1 +/- 0.5"); }, xhr => { throw new Error(xhr.responseText); })' - text: 'Use approximately(actual, expected, range) - Chose the correct range' - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=9'').then(data => { assert.equal(data.assertions[1].method, ''approximately''); assert.equal(data.assertions[1].args[2], 0.8, ''weirdNumbers(0.2) is in the range (0.2, 1.2]. It\''s within 1 +/- 0.8''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=9").then(data => { assert.equal(data.assertions[1].method, "approximately"); assert.equal(data.assertions[1].args[2], 0.8, "weirdNumbers(0.2) is in the range (0.2, 1.2]. It\"s within 1 +/- 0.8"); }, xhr => { throw new Error(xhr.responseText); })' ``` diff --git a/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/test-if-a-value-is-a-string.english.md b/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/test-if-a-value-is-a-string.english.md index db5681e71c..54490b3961 100644 --- a/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/test-if-a-value-is-a-string.english.md +++ b/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/test-if-a-value-is-a-string.english.md @@ -21,13 +21,13 @@ As a reminder, this project is being built upon the following starter project on ```yml tests: - text: All tests should pass - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=12'').then(data => { assert.equal(data.state,''passed''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=12").then(data => { assert.equal(data.state,"passed"); }, xhr => { throw new Error(xhr.responseText); })' - text: Choose the right assertion - isString vs. isNotString - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=12'').then(data => { assert.equal(data.assertions[0].method, ''isNotString'', ''A float number is not a string''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=12").then(data => { assert.equal(data.assertions[0].method, "isNotString", "A float number is not a string"); }, xhr => { throw new Error(xhr.responseText); })' - text: Choose the right assertion - isString vs. isNotString - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=12'').then(data => { assert.equal(data.assertions[1].method, ''isString'', ''environment vars are strings (or undefined)''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=12").then(data => { assert.equal(data.assertions[1].method, "isString", "environment vars are strings (or undefined)"); }, xhr => { throw new Error(xhr.responseText); })' - text: Choose the right assertion - isString vs. isNotString - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=12'').then(data => { assert.equal(data.assertions[2].method, ''isString'', ''A JSON is a string''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=12").then(data => { assert.equal(data.assertions[2].method, "isString", "A JSON is a string"); }, xhr => { throw new Error(xhr.responseText); })' ``` diff --git a/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/test-if-a-value-is-an-array.english.md b/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/test-if-a-value-is-an-array.english.md index e85ec8f4fd..2b477d91dd 100644 --- a/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/test-if-a-value-is-an-array.english.md +++ b/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/test-if-a-value-is-an-array.english.md @@ -20,11 +20,11 @@ As a reminder, this project is being built upon the following starter project on ```yml tests: - text: All tests should pass - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=10'').then(data => {assert.equal(data.state,''passed''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=10").then(data => {assert.equal(data.state,"passed"); }, xhr => { throw new Error(xhr.responseText); })' - text: Choose the right assertion - isArray vs. isNotArray - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=10'').then(data => { assert.equal(data.assertions[0].method, ''isArray'', ''String.prototype.split() returns an Array''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=10").then(data => { assert.equal(data.assertions[0].method, "isArray", "String.prototype.split() returns an Array"); }, xhr => { throw new Error(xhr.responseText); })' - text: Choose the right assertion - isArray vs. isNotArray - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=10'').then(data => { assert.equal(data.assertions[1].method, ''isNotArray'', ''Array.prototype.indexOf() returns a number''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=10").then(data => { assert.equal(data.assertions[1].method, "isNotArray", "Array.prototype.indexOf() returns a number"); }, xhr => { throw new Error(xhr.responseText); })' ``` diff --git a/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/test-if-a-value-is-of-a-specific-data-structure-type.english.md b/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/test-if-a-value-is-of-a-specific-data-structure-type.english.md index 40c8db45fe..25417a7f10 100644 --- a/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/test-if-a-value-is-of-a-specific-data-structure-type.english.md +++ b/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/test-if-a-value-is-of-a-specific-data-structure-type.english.md @@ -22,17 +22,17 @@ Use #typeOf or #notTypeOf where appropriate ```yml tests: - text: All tests should pass - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=16'').then(data => { assert.equal(data.state,''passed''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=16").then(data => { assert.equal(data.state,"passed"); }, xhr => { throw new Error(xhr.responseText); })' - text: Choose the right assertion - typeOf vs. notTypeOf - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=16'').then(data => { assert.equal(data.assertions[0].method, ''typeOf'', ''myCar is typeOf Object''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=16").then(data => { assert.equal(data.assertions[0].method, "typeOf", "myCar is typeOf Object"); }, xhr => { throw new Error(xhr.responseText); })' - text: Choose the right assertion - typeOf vs. notTypeOf - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=16'').then(data => { assert.equal(data.assertions[1].method, ''typeOf'', ''Car.model is a String''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=16").then(data => { assert.equal(data.assertions[1].method, "typeOf", "Car.model is a String"); }, xhr => { throw new Error(xhr.responseText); })' - text: Choose the right assertion - typeOf vs. notTypeOf - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=16'').then(data => { assert.equal(data.assertions[2].method, ''notTypeOf'', ''Plane.wings is a Number (not a String)''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=16").then(data => { assert.equal(data.assertions[2].method, "notTypeOf", "Plane.wings is a Number (not a String)"); }, xhr => { throw new Error(xhr.responseText); })' - text: Choose the right assertion - typeOf vs. notTypeOf - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=16'').then(data => { assert.equal(data.assertions[3].method, ''typeOf'', ''Plane.engines is an Array''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=16").then(data => { assert.equal(data.assertions[3].method, "typeOf", "Plane.engines is an Array"); }, xhr => { throw new Error(xhr.responseText); })' - text: Choose the right assertion - typeOf vs. notTypeOf - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=16'').then(data => { assert.equal(data.assertions[4].method, ''typeOf'', ''Car.wheels is a Number''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=16").then(data => { assert.equal(data.assertions[4].method, "typeOf", "Car.wheels is a Number"); }, xhr => { throw new Error(xhr.responseText); })' ``` diff --git a/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/test-if-a-variable-or-function-is-defined.english.md b/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/test-if-a-variable-or-function-is-defined.english.md index bc5ca3565f..51c4d3b3aa 100644 --- a/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/test-if-a-variable-or-function-is-defined.english.md +++ b/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/test-if-a-variable-or-function-is-defined.english.md @@ -21,13 +21,13 @@ Use assert.isDefined() or assert.isUndefined() to make the tests pass ```yml tests: - text: All tests should pass - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=1'').then(data => {assert.equal(data.state,''passed''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=1").then(data => {assert.equal(data.state,"passed"); }, xhr => { throw new Error(xhr.responseText); })' - text: Choose the right assertion - isDefined vs. isUndefined - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=1'').then(data => { assert.equal(data.assertions[0].method, ''isDefined'', ''Null is not undefined''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=1").then(data => { assert.equal(data.assertions[0].method, "isDefined", "Null is not undefined"); }, xhr => { throw new Error(xhr.responseText); })' - text: Choose the right assertion - isDefined vs. isUndefined - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=1'').then(data => { assert.equal(data.assertions[1].method, ''isUndefined'', ''Undefined is undefined''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=1").then(data => { assert.equal(data.assertions[1].method, "isUndefined", "Undefined is undefined"); }, xhr => { throw new Error(xhr.responseText); })' - text: Choose the right assertion - isDefined vs. isUndefined - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=1'').then(data => { assert.equal(data.assertions[2].method, ''isDefined'', ''A string is not undefined''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=1").then(data => { assert.equal(data.assertions[2].method, "isDefined", "A string is not undefined"); }, xhr => { throw new Error(xhr.responseText); })' ``` diff --git a/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/test-if-an-array-contains-an-item.english.md b/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/test-if-an-array-contains-an-item.english.md index ad7ee587f0..7a56623306 100644 --- a/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/test-if-an-array-contains-an-item.english.md +++ b/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/test-if-an-array-contains-an-item.english.md @@ -20,11 +20,11 @@ As a reminder, this project is being built upon the following starter project on ```yml tests: - text: All tests should pass - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=11'').then(data => { assert.equal(data.state,''passed''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=11").then(data => { assert.equal(data.state,"passed"); }, xhr => { throw new Error(xhr.responseText); })' - text: Choose the right assertion - include vs. notInclude - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=11'').then(data => { assert.equal(data.assertions[0].method, ''notInclude'', ''It\''s summer in july...''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=11").then(data => { assert.equal(data.assertions[0].method, "notInclude", "It\"s summer in july..."); }, xhr => { throw new Error(xhr.responseText); })' - text: Choose the right assertion - include vs. notInclude - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=11'').then(data => { assert.equal(data.assertions[1].method, ''include'', ''JavaScript is a backend language !!''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=11").then(data => { assert.equal(data.assertions[1].method, "include", "JavaScript is a backend language !!"); }, xhr => { throw new Error(xhr.responseText); })' ``` diff --git a/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/test-if-an-object-has-a-property.english.md b/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/test-if-an-object-has-a-property.english.md index 51050ffc20..89f662bca4 100644 --- a/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/test-if-an-object-has-a-property.english.md +++ b/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/test-if-an-object-has-a-property.english.md @@ -22,13 +22,13 @@ Use #property or #notProperty where appropriate ```yml tests: - text: All tests should pass - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=15'').then(data => { assert.equal(data.state,''passed''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=15").then(data => { assert.equal(data.state,"passed"); }, xhr => { throw new Error(xhr.responseText); })' - text: Choose the right assertion - property vs. notProperty - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=15'').then(data => { assert.equal(data.assertions[0].method, ''notProperty'', ''A car has not wings''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=15").then(data => { assert.equal(data.assertions[0].method, "notProperty", "A car has not wings"); }, xhr => { throw new Error(xhr.responseText); })' - text: Choose the right assertion - property vs. notProperty - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=15'').then(data => { assert.equal(data.assertions[1].method, ''property'', ''planes have engines''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=15").then(data => { assert.equal(data.assertions[1].method, "property", "planes have engines"); }, xhr => { throw new Error(xhr.responseText); })' - text: Choose the right assertion - property vs. notProperty - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=15'').then(data => { assert.equal(data.assertions[2].method, ''property'', ''Cars have wheels''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=15").then(data => { assert.equal(data.assertions[2].method, "property", "Cars have wheels"); }, xhr => { throw new Error(xhr.responseText); })' ``` diff --git a/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/test-if-an-object-is-an-instance-of-a-constructor.english.md b/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/test-if-an-object-is-an-instance-of-a-constructor.english.md index 7ed96bb08d..a2f8f4cf7a 100644 --- a/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/test-if-an-object-is-an-instance-of-a-constructor.english.md +++ b/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/test-if-an-object-is-an-instance-of-a-constructor.english.md @@ -22,15 +22,15 @@ Use #instanceOf or #notInstanceOf where appropriate ```yml tests: - text: All tests should pass - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=17'').then(data => { assert.equal(data.state,''passed''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=17").then(data => { assert.equal(data.state,"passed"); }, xhr => { throw new Error(xhr.responseText); })' - text: Choose the right assertion - instanceOf vs. notInstanceOf - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=17'').then(data => { assert.equal(data.assertions[0].method, ''notInstanceOf'', ''myCar is not an instance of Plane''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=17").then(data => { assert.equal(data.assertions[0].method, "notInstanceOf", "myCar is not an instance of Plane"); }, xhr => { throw new Error(xhr.responseText); })' - text: Choose the right assertion - instanceOf vs. notInstanceOf - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=17'').then(data => { assert.equal(data.assertions[1].method, ''instanceOf'', ''airlinePlane is an instance of Plane''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=17").then(data => { assert.equal(data.assertions[1].method, "instanceOf", "airlinePlane is an instance of Plane"); }, xhr => { throw new Error(xhr.responseText); })' - text: Choose the right assertion - instanceOf vs. notInstanceOf - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=17'').then(data => { assert.equal(data.assertions[2].method, ''instanceOf'', ''everything is an Object in JavaScript...''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=17").then(data => { assert.equal(data.assertions[2].method, "instanceOf", "everything is an Object in JavaScript..."); }, xhr => { throw new Error(xhr.responseText); })' - text: Choose the right assertion - instanceOf vs. notInstanceOf - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=17'').then(data => { assert.equal(data.assertions[3].method, ''notInstanceOf'', ''myCar.wheels is not an instance of String''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=17").then(data => { assert.equal(data.assertions[3].method, "notInstanceOf", "myCar.wheels is not an instance of String"); }, xhr => { throw new Error(xhr.responseText); })' ``` diff --git a/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/test-if-one-value-is-below-or-at-least-as-large-as-another.english.md b/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/test-if-one-value-is-below-or-at-least-as-large-as-another.english.md index acb5df97a8..ccaad37ebd 100644 --- a/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/test-if-one-value-is-below-or-at-least-as-large-as-another.english.md +++ b/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/test-if-one-value-is-below-or-at-least-as-large-as-another.english.md @@ -21,15 +21,15 @@ As a reminder, this project is being built upon the following starter project on ```yml tests: - text: All tests should pass - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=8'').then(data => {assert.equal(data.state,''passed''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=8").then(data => {assert.equal(data.state,"passed"); }, xhr => { throw new Error(xhr.responseText); })' - text: Choose the right assertion - isBelow vs. isAtLeast - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=8'').then(data => { assert.equal(data.assertions[0].method, ''isAtLeast'', ''5 is at least (>=) 5''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=8").then(data => { assert.equal(data.assertions[0].method, "isAtLeast", "5 is at least (>=) 5"); }, xhr => { throw new Error(xhr.responseText); })' - text: Choose the right assertion - isBelow vs. isAtLeast - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=8'').then(data => { assert.equal(data.assertions[1].method, ''isAtLeast'', ''2 * Math.random() is at least 0''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=8").then(data => { assert.equal(data.assertions[1].method, "isAtLeast", "2 * Math.random() is at least 0"); }, xhr => { throw new Error(xhr.responseText); })' - text: Choose the right assertion - isBelow vs. isAtLeast - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=8'').then(data => { assert.equal(data.assertions[2].method, ''isBelow'', ''1 is smaller than 2''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=8").then(data => { assert.equal(data.assertions[2].method, "isBelow", "1 is smaller than 2"); }, xhr => { throw new Error(xhr.responseText); })' - text: Choose the right assertion - isBelow vs. isAtLeast - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=8'').then(data => { assert.equal(data.assertions[3].method, ''isBelow'', ''2/3 (0.6666) is smaller than 1''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=8").then(data => { assert.equal(data.assertions[3].method, "isBelow", "2/3 (0.6666) is smaller than 1"); }, xhr => { throw new Error(xhr.responseText); })' ``` diff --git a/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/use-assert.isok-and-assert.isnotok.english.md b/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/use-assert.isok-and-assert.isnotok.english.md index d7e13c6369..0454ce87b4 100644 --- a/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/use-assert.isok-and-assert.isnotok.english.md +++ b/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/use-assert.isok-and-assert.isnotok.english.md @@ -22,13 +22,13 @@ Use assert.isOk() or assert.isNotOk() to make the tests pass. ```yml tests: - text: All tests should pass - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=2'').then(data => {assert.equal(data.state,''passed''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=2").then(data => {assert.equal(data.state,"passed"); }, xhr => { throw new Error(xhr.responseText); })' - text: Choose the right assertion - isOk vs. isNotOk - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=2'').then(data => { assert.equal(data.assertions[0].method, ''isNotOk'', ''Null is falsey''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=2").then(data => { assert.equal(data.assertions[0].method, "isNotOk", "Null is falsey"); }, xhr => { throw new Error(xhr.responseText); })' - text: Choose the right assertion - isOk vs. isNotOk - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=2'').then(data => { assert.equal(data.assertions[1].method, ''isOk'',''A string is truthy''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=2").then(data => { assert.equal(data.assertions[1].method, "isOk","A string is truthy"); }, xhr => { throw new Error(xhr.responseText); })' - text: Choose the right assertion - isOk vs. isNotOk - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=2'').then(data => { assert.equal(data.assertions[2].method, ''isOk'', ''true is truthy''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=2").then(data => { assert.equal(data.assertions[2].method, "isOk", "true is truthy"); }, xhr => { throw new Error(xhr.responseText); })' ``` diff --git a/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/use-regular-expressions-to-test-a-string.english.md b/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/use-regular-expressions-to-test-a-string.english.md index ec6f2addad..88ab1e8baa 100644 --- a/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/use-regular-expressions-to-test-a-string.english.md +++ b/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/use-regular-expressions-to-test-a-string.english.md @@ -22,11 +22,11 @@ matches the second argument regular expression. ```yml tests: - text: All tests should pass - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=14'').then(data => { assert.equal(data.state,''passed''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=14").then(data => { assert.equal(data.state,"passed"); }, xhr => { throw new Error(xhr.responseText); })' - text: Choose the right assertion - match vs. notMatch - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=14'').then(data => { assert.equal(data.assertions[0].method, ''match'', ''\''# name: John Doe, age: 35\'' matches the regex''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=14").then(data => { assert.equal(data.assertions[0].method, "match", "\"# name: John Doe, age: 35\" matches the regex"); }, xhr => { throw new Error(xhr.responseText); })' - text: Choose the right assertion - match vs. notMatch - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=14'').then(data => { assert.equal(data.assertions[1].method, ''notMatch'', ''\''# name: Paul Smith III, age: twenty-four\'' does not match the regex (the age must be numeric)''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=14").then(data => { assert.equal(data.assertions[1].method, "notMatch", "\"# name: Paul Smith III, age: twenty-four\" does not match the regex (the age must be numeric)"); }, xhr => { throw new Error(xhr.responseText); })' ``` diff --git a/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/use-the-double-equals-to-assert-equality.english.md b/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/use-the-double-equals-to-assert-equality.english.md index 12e4c9ce8c..ec39146030 100644 --- a/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/use-the-double-equals-to-assert-equality.english.md +++ b/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/use-the-double-equals-to-assert-equality.english.md @@ -22,15 +22,15 @@ As a reminder, this project is being built upon the following starter project on ```yml tests: - text: All tests should pass - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=4'').then(data => {assert.equal(data.state,''passed''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=4").then(data => {assert.equal(data.state,"passed"); }, xhr => { throw new Error(xhr.responseText); })' - text: Choose the right assertion - equal vs. notEqual - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=4'').then(data => { assert.equal(data.assertions[0].method, ''equal'', ''Numbers are coerced into strings with == ''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=4").then(data => { assert.equal(data.assertions[0].method, "equal", "Numbers are coerced into strings with == "); }, xhr => { throw new Error(xhr.responseText); })' - text: Choose the right assertion - equal vs. notEqual - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=4'').then(data => { assert.equal(data.assertions[1].method, ''notEqual'', '' == compares object references''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=4").then(data => { assert.equal(data.assertions[1].method, "notEqual", " == compares object references"); }, xhr => { throw new Error(xhr.responseText); })' - text: Choose the right assertion - equal vs. notEqual - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=4'').then(data => { assert.equal(data.assertions[2].method, ''equal'', ''6 * \''2\'' is 12 ! It should be equal to \''12\''''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=4").then(data => { assert.equal(data.assertions[2].method, "equal", "6 * \"2\" is 12 ! It should be equal to \"12\""); }, xhr => { throw new Error(xhr.responseText); })' - text: Choose the right assertion - equal vs. notEqual - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=4'').then(data => { assert.equal(data.assertions[3].method, ''notEqual'', ''6 + \''2\'' is \''62\''...''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=4").then(data => { assert.equal(data.assertions[3].method, "notEqual", "6 + \"2\" is \"62\"..."); }, xhr => { throw new Error(xhr.responseText); })' ``` diff --git a/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/use-the-triple-equals-to-assert-strict-equality.english.md b/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/use-the-triple-equals-to-assert-strict-equality.english.md index 986d4a57e9..ca48cbdf26 100644 --- a/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/use-the-triple-equals-to-assert-strict-equality.english.md +++ b/curriculum/challenges/english/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai/use-the-triple-equals-to-assert-strict-equality.english.md @@ -22,15 +22,15 @@ As a reminder, this project is being built upon the following starter project on ```yml tests: - text: All tests should pass - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=5'').then(data => {assert.equal(data.state,''passed''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=5").then(data => {assert.equal(data.state,"passed"); }, xhr => { throw new Error(xhr.responseText); })' - text: Choose the right assertion - strictEqual vs. notStrictEqual - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=5'').then(data => { assert.equal(data.assertions[0].method, ''notStrictEqual'', ''with strictEqual the type must match''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=5").then(data => { assert.equal(data.assertions[0].method, "notStrictEqual", "with strictEqual the type must match"); }, xhr => { throw new Error(xhr.responseText); })' - text: Choose the right assertion - strictEqual vs. notStrictEqual - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=5'').then(data => { assert.equal(data.assertions[1].method, ''strictEqual'', ''3*2 = 6...''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=5").then(data => { assert.equal(data.assertions[1].method, "strictEqual", "3*2 = 6..."); }, xhr => { throw new Error(xhr.responseText); })' - text: Choose the right assertion - strictEqual vs. notStrictEqual - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=5'').then(data => { assert.equal(data.assertions[2].method, ''strictEqual'', ''6 * \''2\'' is 12. Types match !''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=5").then(data => { assert.equal(data.assertions[2].method, "strictEqual", "6 * \"2\" is 12. Types match !"); }, xhr => { throw new Error(xhr.responseText); })' - text: Choose the right assertion - strictEqual vs. notStrictEqual - testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=5'').then(data => { assert.equal(data.assertions[3].method, ''notStrictEqual'', ''Even if they have the same elements, the Arrays are notStrictEqual''); }, xhr => { throw new Error(xhr.responseText); })' + testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=unit&n=5").then(data => { assert.equal(data.assertions[3].method, "notStrictEqual", "Even if they have the same elements, the Arrays are notStrictEqual"); }, xhr => { throw new Error(xhr.responseText); })' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/algorithms/find-the-symmetric-difference.english.md b/curriculum/challenges/english/08-coding-interview-prep/algorithms/find-the-symmetric-difference.english.md index 9106ff69ef..feb416b80b 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/algorithms/find-the-symmetric-difference.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/algorithms/find-the-symmetric-difference.english.md @@ -22,33 +22,33 @@ Remember to use sym([1, 2, 3], [5, 2, 1, 4]) should return [3, 4, 5].' - testString: 'assert.sameMembers(sym([1, 2, 3], [5, 2, 1, 4]), [3, 4, 5], ''sym([1, 2, 3], [5, 2, 1, 4]) should return [3, 4, 5].'');' + testString: 'assert.sameMembers(sym([1, 2, 3], [5, 2, 1, 4]), [3, 4, 5], "sym([1, 2, 3], [5, 2, 1, 4]) should return [3, 4, 5].");' - text: 'sym([1, 2, 3], [5, 2, 1, 4]) should contain only three elements.' - testString: 'assert.equal(sym([1, 2, 3], [5, 2, 1, 4]).length, 3, ''sym([1, 2, 3], [5, 2, 1, 4]) should contain only three elements.'');' + testString: 'assert.equal(sym([1, 2, 3], [5, 2, 1, 4]).length, 3, "sym([1, 2, 3], [5, 2, 1, 4]) should contain only three elements.");' - text: 'sym([1, 2, 3, 3], [5, 2, 1, 4]) should return [3, 4, 5].' - testString: 'assert.sameMembers(sym([1, 2, 3, 3], [5, 2, 1, 4]), [3, 4, 5], ''sym([1, 2, 3, 3], [5, 2, 1, 4]) should return [3, 4, 5].'');' + testString: 'assert.sameMembers(sym([1, 2, 3, 3], [5, 2, 1, 4]), [3, 4, 5], "sym([1, 2, 3, 3], [5, 2, 1, 4]) should return [3, 4, 5].");' - text: 'sym([1, 2, 3, 3], [5, 2, 1, 4]) should contain only three elements.' - testString: 'assert.equal(sym([1, 2, 3, 3], [5, 2, 1, 4]).length, 3, ''sym([1, 2, 3, 3], [5, 2, 1, 4]) should contain only three elements.'');' + testString: 'assert.equal(sym([1, 2, 3, 3], [5, 2, 1, 4]).length, 3, "sym([1, 2, 3, 3], [5, 2, 1, 4]) should contain only three elements.");' - text: 'sym([1, 2, 3], [5, 2, 1, 4, 5]) should return [3, 4, 5].' - testString: 'assert.sameMembers(sym([1, 2, 3], [5, 2, 1, 4, 5]), [3, 4, 5], ''sym([1, 2, 3], [5, 2, 1, 4, 5]) should return [3, 4, 5].'');' + testString: 'assert.sameMembers(sym([1, 2, 3], [5, 2, 1, 4, 5]), [3, 4, 5], "sym([1, 2, 3], [5, 2, 1, 4, 5]) should return [3, 4, 5].");' - text: 'sym([1, 2, 3], [5, 2, 1, 4, 5]) should contain only three elements.' - testString: 'assert.equal(sym([1, 2, 3], [5, 2, 1, 4, 5]).length, 3, ''sym([1, 2, 3], [5, 2, 1, 4, 5]) should contain only three elements.'');' + testString: 'assert.equal(sym([1, 2, 3], [5, 2, 1, 4, 5]).length, 3, "sym([1, 2, 3], [5, 2, 1, 4, 5]) should contain only three elements.");' - text: 'sym([1, 2, 5], [2, 3, 5], [3, 4, 5]) should return [1, 4, 5]' - testString: 'assert.sameMembers(sym([1, 2, 5], [2, 3, 5], [3, 4, 5]), [1, 4, 5], ''sym([1, 2, 5], [2, 3, 5], [3, 4, 5]) should return [1, 4, 5]'');' + testString: 'assert.sameMembers(sym([1, 2, 5], [2, 3, 5], [3, 4, 5]), [1, 4, 5], "sym([1, 2, 5], [2, 3, 5], [3, 4, 5]) should return [1, 4, 5]");' - text: 'sym([1, 2, 5], [2, 3, 5], [3, 4, 5]) should contain only three elements.' - testString: 'assert.equal(sym([1, 2, 5], [2, 3, 5], [3, 4, 5]).length, 3, ''sym([1, 2, 5], [2, 3, 5], [3, 4, 5]) should contain only three elements.'');' + testString: 'assert.equal(sym([1, 2, 5], [2, 3, 5], [3, 4, 5]).length, 3, "sym([1, 2, 5], [2, 3, 5], [3, 4, 5]) should contain only three elements.");' - text: 'sym([1, 1, 2, 5], [2, 2, 3, 5], [3, 4, 5, 5]) should return [1, 4, 5].' - testString: 'assert.sameMembers(sym([1, 1, 2, 5], [2, 2, 3, 5], [3, 4, 5, 5]), [1, 4, 5], ''sym([1, 1, 2, 5], [2, 2, 3, 5], [3, 4, 5, 5]) should return [1, 4, 5].'');' + testString: 'assert.sameMembers(sym([1, 1, 2, 5], [2, 2, 3, 5], [3, 4, 5, 5]), [1, 4, 5], "sym([1, 1, 2, 5], [2, 2, 3, 5], [3, 4, 5, 5]) should return [1, 4, 5].");' - text: 'sym([1, 1, 2, 5], [2, 2, 3, 5], [3, 4, 5, 5]) should contain only three elements.' - testString: 'assert.equal(sym([1, 1, 2, 5], [2, 2, 3, 5], [3, 4, 5, 5]).length, 3, ''sym([1, 1, 2, 5], [2, 2, 3, 5], [3, 4, 5, 5]) should contain only three elements.'');' + testString: 'assert.equal(sym([1, 1, 2, 5], [2, 2, 3, 5], [3, 4, 5, 5]).length, 3, "sym([1, 1, 2, 5], [2, 2, 3, 5], [3, 4, 5, 5]) should contain only three elements.");' - text: 'sym([3, 3, 3, 2, 5], [2, 1, 5, 7], [3, 4, 6, 6], [1, 2, 3]) should return [2, 3, 4, 6, 7].' - testString: 'assert.sameMembers(sym([3, 3, 3, 2, 5], [2, 1, 5, 7], [3, 4, 6, 6], [1, 2, 3]), [2, 3, 4, 6, 7], ''sym([3, 3, 3, 2, 5], [2, 1, 5, 7], [3, 4, 6, 6], [1, 2, 3]) should return [2, 3, 4, 6, 7].'');' + testString: 'assert.sameMembers(sym([3, 3, 3, 2, 5], [2, 1, 5, 7], [3, 4, 6, 6], [1, 2, 3]), [2, 3, 4, 6, 7], "sym([3, 3, 3, 2, 5], [2, 1, 5, 7], [3, 4, 6, 6], [1, 2, 3]) should return [2, 3, 4, 6, 7].");' - text: 'sym([3, 3, 3, 2, 5], [2, 1, 5, 7], [3, 4, 6, 6], [1, 2, 3]) should contain only five elements.' - testString: 'assert.equal(sym([3, 3, 3, 2, 5], [2, 1, 5, 7], [3, 4, 6, 6], [1, 2, 3]).length, 5, ''sym([3, 3, 3, 2, 5], [2, 1, 5, 7], [3, 4, 6, 6], [1, 2, 3]) should contain only five elements.'');' + testString: 'assert.equal(sym([3, 3, 3, 2, 5], [2, 1, 5, 7], [3, 4, 6, 6], [1, 2, 3]).length, 5, "sym([3, 3, 3, 2, 5], [2, 1, 5, 7], [3, 4, 6, 6], [1, 2, 3]) should contain only five elements.");' - text: 'sym([3, 3, 3, 2, 5], [2, 1, 5, 7], [3, 4, 6, 6], [1, 2, 3], [5, 3, 9, 8], [1]) should return [1, 2, 4, 5, 6, 7, 8, 9].' - testString: 'assert.sameMembers(sym([3, 3, 3, 2, 5], [2, 1, 5, 7], [3, 4, 6, 6], [1, 2, 3], [5, 3, 9, 8], [1]), [1, 2, 4, 5, 6, 7, 8, 9], ''sym([3, 3, 3, 2, 5], [2, 1, 5, 7], [3, 4, 6, 6], [1, 2, 3], [5, 3, 9, 8], [1]) should return [1, 2, 4, 5, 6, 7, 8, 9].'');' + testString: 'assert.sameMembers(sym([3, 3, 3, 2, 5], [2, 1, 5, 7], [3, 4, 6, 6], [1, 2, 3], [5, 3, 9, 8], [1]), [1, 2, 4, 5, 6, 7, 8, 9], "sym([3, 3, 3, 2, 5], [2, 1, 5, 7], [3, 4, 6, 6], [1, 2, 3], [5, 3, 9, 8], [1]) should return [1, 2, 4, 5, 6, 7, 8, 9].");' - text: 'sym([3, 3, 3, 2, 5], [2, 1, 5, 7], [3, 4, 6, 6], [1, 2, 3], [5, 3, 9, 8], [1]) should contain only eight elements.' - testString: 'assert.equal(sym([3, 3, 3, 2, 5], [2, 1, 5, 7], [3, 4, 6, 6], [1, 2, 3], [5, 3, 9, 8], [1]).length, 8, ''sym([3, 3, 3, 2, 5], [2, 1, 5, 7], [3, 4, 6, 6], [1, 2, 3], [5, 3, 9, 8], [1]) should contain only eight elements.'');' + testString: 'assert.equal(sym([3, 3, 3, 2, 5], [2, 1, 5, 7], [3, 4, 6, 6], [1, 2, 3], [5, 3, 9, 8], [1]).length, 8, "sym([3, 3, 3, 2, 5], [2, 1, 5, 7], [3, 4, 6, 6], [1, 2, 3], [5, 3, 9, 8], [1]) should contain only eight elements.");' ``` @@ -82,7 +82,7 @@ function sym() { var arrays = [].slice.call(arguments); return arrays.reduce(function (symDiff, arr) { return symDiff.concat(arr).filter(function (val, idx, theArr) { - return theArr.indexOf(val) === idx + return theArr.indexOf(val) === idx && (symDiff.indexOf(val) === -1 || arr.indexOf(val) === -1); }); }); diff --git a/curriculum/challenges/english/08-coding-interview-prep/algorithms/implement-bubble-sort.english.md b/curriculum/challenges/english/08-coding-interview-prep/algorithms/implement-bubble-sort.english.md index f1ae96f4a8..16ff19f30d 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/algorithms/implement-bubble-sort.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/algorithms/implement-bubble-sort.english.md @@ -24,13 +24,13 @@ This method requires multiple iterations through the array and for average and w ```yml tests: - text: bubbleSort is a function. - testString: 'assert(typeof bubbleSort == ''function'', ''bubbleSort is a function.'');' + testString: 'assert(typeof bubbleSort == "function", "bubbleSort is a function.");' - text: bubbleSort returns a sorted array (least to greatest). - testString: 'assert(isSorted(bubbleSort([1,4,2,8,345,123,43,32,5643,63,123,43,2,55,1,234,92])), ''bubbleSort returns a sorted array (least to greatest).'');' + testString: 'assert(isSorted(bubbleSort([1,4,2,8,345,123,43,32,5643,63,123,43,2,55,1,234,92])), "bubbleSort returns a sorted array (least to greatest).");' - text: bubbleSort returns an array that is unchanged except for order. - testString: 'assert.sameMembers(bubbleSort([1,4,2,8,345,123,43,32,5643,63,123,43,2,55,1,234,92]), [1,4,2,8,345,123,43,32,5643,63,123,43,2,55,1,234,92], ''bubbleSort returns an array that is unchanged except for order.'');' + testString: 'assert.sameMembers(bubbleSort([1,4,2,8,345,123,43,32,5643,63,123,43,2,55,1,234,92]), [1,4,2,8,345,123,43,32,5643,63,123,43,2,55,1,234,92], "bubbleSort returns an array that is unchanged except for order.");' - text: bubbleSort should not use the built-in .sort() method. - testString: 'assert.strictEqual(code.search(/\.sort\(/), -1, ''bubbleSort should not use the built-in .sort() method.'');' + testString: 'assert.strictEqual(code.search(/\.sort\(/), -1, "bubbleSort should not use the built-in .sort() method.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/algorithms/implement-insertion-sort.english.md b/curriculum/challenges/english/08-coding-interview-prep/algorithms/implement-insertion-sort.english.md index 2012815a10..9e92810cf8 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/algorithms/implement-insertion-sort.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/algorithms/implement-insertion-sort.english.md @@ -22,13 +22,13 @@ The next sorting method we'll look at is insertion sort. This method works by bu ```yml tests: - text: insertionSort is a function. - testString: 'assert(typeof insertionSort == ''function'', ''insertionSort is a function.'');' + testString: 'assert(typeof insertionSort == "function", "insertionSort is a function.");' - text: insertionSort returns a sorted array (least to greatest). - testString: 'assert(isSorted(insertionSort([1,4,2,8,345,123,43,32,5643,63,123,43,2,55,1,234,92])), ''insertionSort returns a sorted array (least to greatest).'');' + testString: 'assert(isSorted(insertionSort([1,4,2,8,345,123,43,32,5643,63,123,43,2,55,1,234,92])), "insertionSort returns a sorted array (least to greatest).");' - text: insertionSort returns an array that is unchanged except for order. - testString: 'assert.sameMembers(insertionSort([1,4,2,8,345,123,43,32,5643,63,123,43,2,55,1,234,92]), [1,4,2,8,345,123,43,32,5643,63,123,43,2,55,1,234,92], ''insertionSort returns an array that is unchanged except for order.'');' + testString: 'assert.sameMembers(insertionSort([1,4,2,8,345,123,43,32,5643,63,123,43,2,55,1,234,92]), [1,4,2,8,345,123,43,32,5643,63,123,43,2,55,1,234,92], "insertionSort returns an array that is unchanged except for order.");' - text: insertionSort should not use the built-in .sort() method. - testString: 'assert.strictEqual(code.search(/\.sort\(/), -1, ''insertionSort should not use the built-in .sort() method.'');' + testString: 'assert.strictEqual(code.search(/\.sort\(/), -1, "insertionSort should not use the built-in .sort() method.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/algorithms/implement-merge-sort.english.md b/curriculum/challenges/english/08-coding-interview-prep/algorithms/implement-merge-sort.english.md index 08cb78417d..cd1246df60 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/algorithms/implement-merge-sort.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/algorithms/implement-merge-sort.english.md @@ -26,13 +26,13 @@ As an aside, this will be the last sorting algorithm we cover here. However, lat ```yml tests: - text: mergeSort is a function. - testString: 'assert(typeof mergeSort == ''function'', ''mergeSort is a function.'');' + testString: 'assert(typeof mergeSort == "function", "mergeSort is a function.");' - text: mergeSort returns a sorted array (least to greatest). - testString: 'assert(isSorted(mergeSort([1,4,2,8,345,123,43,32,5643,63,123,43,2,55,1,234,92])), ''mergeSort returns a sorted array (least to greatest).'');' + testString: 'assert(isSorted(mergeSort([1,4,2,8,345,123,43,32,5643,63,123,43,2,55,1,234,92])), "mergeSort returns a sorted array (least to greatest).");' - text: mergeSort returns an array that is unchanged except for order. - testString: 'assert.sameMembers(mergeSort([1,4,2,8,345,123,43,32,5643,63,123,43,2,55,1,234,92]), [1,4,2,8,345,123,43,32,5643,63,123,43,2,55,1,234,92], ''mergeSort returns an array that is unchanged except for order.'');' + testString: 'assert.sameMembers(mergeSort([1,4,2,8,345,123,43,32,5643,63,123,43,2,55,1,234,92]), [1,4,2,8,345,123,43,32,5643,63,123,43,2,55,1,234,92], "mergeSort returns an array that is unchanged except for order.");' - text: mergeSort should not use the built-in .sort() method. - testString: 'assert.strictEqual(code.search(/\.sort\(/), -1, ''mergeSort should not use the built-in .sort() method.'');' + testString: 'assert.strictEqual(code.search(/\.sort\(/), -1, "mergeSort should not use the built-in .sort() method.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/algorithms/implement-quick-sort.english.md b/curriculum/challenges/english/08-coding-interview-prep/algorithms/implement-quick-sort.english.md index 974bb56b82..cd143db34c 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/algorithms/implement-quick-sort.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/algorithms/implement-quick-sort.english.md @@ -23,13 +23,13 @@ Quick sort is a very efficient sorting method, providing O(nlog(n)) perfo ```yml tests: - text: quickSort is a function. - testString: 'assert(typeof quickSort == ''function'', ''quickSort is a function.'');' + testString: 'assert(typeof quickSort == "function", "quickSort is a function.");' - text: quickSort returns a sorted array (least to greatest). - testString: 'assert(isSorted(quickSort([1,4,2,8,345,123,43,32,5643,63,123,43,2,55,1,234,92])), ''quickSort returns a sorted array (least to greatest).'');' + testString: 'assert(isSorted(quickSort([1,4,2,8,345,123,43,32,5643,63,123,43,2,55,1,234,92])), "quickSort returns a sorted array (least to greatest).");' - text: quickSort returns an array that is unchanged except for order. - testString: 'assert.sameMembers(quickSort([1,4,2,8,345,123,43,32,5643,63,123,43,2,55,1,234,92]), [1,4,2,8,345,123,43,32,5643,63,123,43,2,55,1,234,92], ''quickSort returns an array that is unchanged except for order.'');' + testString: 'assert.sameMembers(quickSort([1,4,2,8,345,123,43,32,5643,63,123,43,2,55,1,234,92]), [1,4,2,8,345,123,43,32,5643,63,123,43,2,55,1,234,92], "quickSort returns an array that is unchanged except for order.");' - text: quickSort should not use the built-in .sort() method. - testString: 'assert.strictEqual(code.search(/\.sort\(/), -1, ''quickSort should not use the built-in .sort() method.'');' + testString: 'assert.strictEqual(code.search(/\.sort\(/), -1, "quickSort should not use the built-in .sort() method.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/algorithms/implement-selection-sort.english.md b/curriculum/challenges/english/08-coding-interview-prep/algorithms/implement-selection-sort.english.md index bc08e3b183..5db8e11ad0 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/algorithms/implement-selection-sort.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/algorithms/implement-selection-sort.english.md @@ -22,13 +22,13 @@ Here we will implement selection sort. Selection sort works by selecting the min ```yml tests: - text: selectionSort is a function. - testString: 'assert(typeof selectionSort == ''function'', ''selectionSort is a function.'');' + testString: 'assert(typeof selectionSort == "function", "selectionSort is a function.");' - text: selectionSort returns a sorted array (least to greatest). - testString: 'assert(isSorted(selectionSort([1,4,2,8,345,123,43,32,5643,63,123,43,2,55,1,234,92])), ''selectionSort returns a sorted array (least to greatest).'');' + testString: 'assert(isSorted(selectionSort([1,4,2,8,345,123,43,32,5643,63,123,43,2,55,1,234,92])), "selectionSort returns a sorted array (least to greatest).");' - text: selectionSort returns an array that is unchanged except for order. - testString: 'assert.sameMembers(selectionSort([1,4,2,8,345,123,43,32,5643,63,123,43,2,55,1,234,92]), [1,4,2,8,345,123,43,32,5643,63,123,43,2,55,1,234,92], ''selectionSort returns an array that is unchanged except for order.'');' + testString: 'assert.sameMembers(selectionSort([1,4,2,8,345,123,43,32,5643,63,123,43,2,55,1,234,92]), [1,4,2,8,345,123,43,32,5643,63,123,43,2,55,1,234,92], "selectionSort returns an array that is unchanged except for order.");' - text: selectionSort should not use the built-in .sort() method. - testString: 'assert.strictEqual(code.search(/\.sort\(/), -1, ''selectionSort should not use the built-in .sort() method.'');' + testString: 'assert.strictEqual(code.search(/\.sort\(/), -1, "selectionSort should not use the built-in .sort() method.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/algorithms/inventory-update.english.md b/curriculum/challenges/english/08-coding-interview-prep/algorithms/inventory-update.english.md index 938e2ae71f..0f23a1e25c 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/algorithms/inventory-update.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/algorithms/inventory-update.english.md @@ -21,17 +21,17 @@ Remember to use updateInventory should return an array.'');' + testString: 'assert.isArray(updateInventory([[21, "Bowling Ball"], [2, "Dirty Sock"], [1, "Hair Pin"], [5, "Microphone"]], [[2, "Hair Pin"], [3, "Half-Eaten Apple"], [67, "Bowling Ball"], [7, "Toothpaste"]]), "The function updateInventory should return an array.");' - text: 'updateInventory([[21, "Bowling Ball"], [2, "Dirty Sock"], [1, "Hair Pin"], [5, "Microphone"]], [[2, "Hair Pin"], [3, "Half-Eaten Apple"], [67, "Bowling Ball"], [7, "Toothpaste"]]) should return an array with a length of 6.' - testString: 'assert.equal(updateInventory([[21, "Bowling Ball"], [2, "Dirty Sock"], [1, "Hair Pin"], [5, "Microphone"]], [[2, "Hair Pin"], [3, "Half-Eaten Apple"], [67, "Bowling Ball"], [7, "Toothpaste"]]).length, 6, ''updateInventory([[21, "Bowling Ball"], [2, "Dirty Sock"], [1, "Hair Pin"], [5, "Microphone"]], [[2, "Hair Pin"], [3, "Half-Eaten Apple"], [67, "Bowling Ball"], [7, "Toothpaste"]]) should return an array with a length of 6.'');' + testString: 'assert.equal(updateInventory([[21, "Bowling Ball"], [2, "Dirty Sock"], [1, "Hair Pin"], [5, "Microphone"]], [[2, "Hair Pin"], [3, "Half-Eaten Apple"], [67, "Bowling Ball"], [7, "Toothpaste"]]).length, 6, "updateInventory([[21, "Bowling Ball"], [2, "Dirty Sock"], [1, "Hair Pin"], [5, "Microphone"]], [[2, "Hair Pin"], [3, "Half-Eaten Apple"], [67, "Bowling Ball"], [7, "Toothpaste"]]) should return an array with a length of 6.");' - text: 'updateInventory([[21, "Bowling Ball"], [2, "Dirty Sock"], [1, "Hair Pin"], [5, "Microphone"]], [[2, "Hair Pin"], [3, "Half-Eaten Apple"], [67, "Bowling Ball"], [7, "Toothpaste"]]) should return [[88, "Bowling Ball"], [2, "Dirty Sock"], [3, "Hair Pin"], [3, "Half-Eaten Apple"], [5, "Microphone"], [7, "Toothpaste"]].' - testString: 'assert.deepEqual(updateInventory([[21, "Bowling Ball"], [2, "Dirty Sock"], [1, "Hair Pin"], [5, "Microphone"]], [[2, "Hair Pin"], [3, "Half-Eaten Apple"], [67, "Bowling Ball"], [7, "Toothpaste"]]), [[88, "Bowling Ball"], [2, "Dirty Sock"], [3, "Hair Pin"], [3, "Half-Eaten Apple"], [5, "Microphone"], [7, "Toothpaste"]], ''updateInventory([[21, "Bowling Ball"], [2, "Dirty Sock"], [1, "Hair Pin"], [5, "Microphone"]], [[2, "Hair Pin"], [3, "Half-Eaten Apple"], [67, "Bowling Ball"], [7, "Toothpaste"]]) should return [[88, "Bowling Ball"], [2, "Dirty Sock"], [3, "Hair Pin"], [3, "Half-Eaten Apple"], [5, "Microphone"], [7, "Toothpaste"]].'');' + testString: 'assert.deepEqual(updateInventory([[21, "Bowling Ball"], [2, "Dirty Sock"], [1, "Hair Pin"], [5, "Microphone"]], [[2, "Hair Pin"], [3, "Half-Eaten Apple"], [67, "Bowling Ball"], [7, "Toothpaste"]]), [[88, "Bowling Ball"], [2, "Dirty Sock"], [3, "Hair Pin"], [3, "Half-Eaten Apple"], [5, "Microphone"], [7, "Toothpaste"]], "updateInventory([[21, "Bowling Ball"], [2, "Dirty Sock"], [1, "Hair Pin"], [5, "Microphone"]], [[2, "Hair Pin"], [3, "Half-Eaten Apple"], [67, "Bowling Ball"], [7, "Toothpaste"]]) should return [[88, "Bowling Ball"], [2, "Dirty Sock"], [3, "Hair Pin"], [3, "Half-Eaten Apple"], [5, "Microphone"], [7, "Toothpaste"]].");' - text: 'updateInventory([[21, "Bowling Ball"], [2, "Dirty Sock"], [1, "Hair Pin"], [5, "Microphone"]], []) should return [[21, "Bowling Ball"], [2, "Dirty Sock"], [1, "Hair Pin"], [5, "Microphone"]].' - testString: 'assert.deepEqual(updateInventory([[21, "Bowling Ball"], [2, "Dirty Sock"], [1, "Hair Pin"], [5, "Microphone"]], []), [[21, "Bowling Ball"], [2, "Dirty Sock"], [1, "Hair Pin"], [5, "Microphone"]], ''updateInventory([[21, "Bowling Ball"], [2, "Dirty Sock"], [1, "Hair Pin"], [5, "Microphone"]], []) should return [[21, "Bowling Ball"], [2, "Dirty Sock"], [1, "Hair Pin"], [5, "Microphone"]].'');' + testString: 'assert.deepEqual(updateInventory([[21, "Bowling Ball"], [2, "Dirty Sock"], [1, "Hair Pin"], [5, "Microphone"]], []), [[21, "Bowling Ball"], [2, "Dirty Sock"], [1, "Hair Pin"], [5, "Microphone"]], "updateInventory([[21, "Bowling Ball"], [2, "Dirty Sock"], [1, "Hair Pin"], [5, "Microphone"]], []) should return [[21, "Bowling Ball"], [2, "Dirty Sock"], [1, "Hair Pin"], [5, "Microphone"]].");' - text: 'updateInventory([], [[2, "Hair Pin"], [3, "Half-Eaten Apple"], [67, "Bowling Ball"], [7, "Toothpaste"]]) should return [[67, "Bowling Ball"], [2, "Hair Pin"], [3, "Half-Eaten Apple"], [7, "Toothpaste"]].' - testString: 'assert.deepEqual(updateInventory([], [[2, "Hair Pin"], [3, "Half-Eaten Apple"], [67, "Bowling Ball"], [7, "Toothpaste"]]), [[67, "Bowling Ball"], [2, "Hair Pin"], [3, "Half-Eaten Apple"], [7, "Toothpaste"]], ''updateInventory([], [[2, "Hair Pin"], [3, "Half-Eaten Apple"], [67, "Bowling Ball"], [7, "Toothpaste"]]) should return [[67, "Bowling Ball"], [2, "Hair Pin"], [3, "Half-Eaten Apple"], [7, "Toothpaste"]].'');' + testString: 'assert.deepEqual(updateInventory([], [[2, "Hair Pin"], [3, "Half-Eaten Apple"], [67, "Bowling Ball"], [7, "Toothpaste"]]), [[67, "Bowling Ball"], [2, "Hair Pin"], [3, "Half-Eaten Apple"], [7, "Toothpaste"]], "updateInventory([], [[2, "Hair Pin"], [3, "Half-Eaten Apple"], [67, "Bowling Ball"], [7, "Toothpaste"]]) should return [[67, "Bowling Ball"], [2, "Hair Pin"], [3, "Half-Eaten Apple"], [7, "Toothpaste"]].");' - text: 'updateInventory([[0, "Bowling Ball"], [0, "Dirty Sock"], [0, "Hair Pin"], [0, "Microphone"]], [[1, "Hair Pin"], [1, "Half-Eaten Apple"], [1, "Bowling Ball"], [1, "Toothpaste"]]) should return [[1, "Bowling Ball"], [0, "Dirty Sock"], [1, "Hair Pin"], [1, "Half-Eaten Apple"], [0, "Microphone"], [1, "Toothpaste"]].' - testString: 'assert.deepEqual(updateInventory([[0, "Bowling Ball"], [0, "Dirty Sock"], [0, "Hair Pin"], [0, "Microphone"]], [[1, "Hair Pin"], [1, "Half-Eaten Apple"], [1, "Bowling Ball"], [1, "Toothpaste"]]), [[1, "Bowling Ball"], [0, "Dirty Sock"], [1, "Hair Pin"], [1, "Half-Eaten Apple"], [0, "Microphone"], [1, "Toothpaste"]], ''updateInventory([[0, "Bowling Ball"], [0, "Dirty Sock"], [0, "Hair Pin"], [0, "Microphone"]], [[1, "Hair Pin"], [1, "Half-Eaten Apple"], [1, "Bowling Ball"], [1, "Toothpaste"]]) should return [[1, "Bowling Ball"], [0, "Dirty Sock"], [1, "Hair Pin"], [1, "Half-Eaten Apple"], [0, "Microphone"], [1, "Toothpaste"]].'');' + testString: 'assert.deepEqual(updateInventory([[0, "Bowling Ball"], [0, "Dirty Sock"], [0, "Hair Pin"], [0, "Microphone"]], [[1, "Hair Pin"], [1, "Half-Eaten Apple"], [1, "Bowling Ball"], [1, "Toothpaste"]]), [[1, "Bowling Ball"], [0, "Dirty Sock"], [1, "Hair Pin"], [1, "Half-Eaten Apple"], [0, "Microphone"], [1, "Toothpaste"]], "updateInventory([[0, "Bowling Ball"], [0, "Dirty Sock"], [0, "Hair Pin"], [0, "Microphone"]], [[1, "Hair Pin"], [1, "Half-Eaten Apple"], [1, "Bowling Ball"], [1, "Toothpaste"]]) should return [[1, "Bowling Ball"], [0, "Dirty Sock"], [1, "Hair Pin"], [1, "Half-Eaten Apple"], [0, "Microphone"], [1, "Toothpaste"]].");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/algorithms/no-repeats-please.english.md b/curriculum/challenges/english/08-coding-interview-prep/algorithms/no-repeats-please.english.md index e849788da2..15b3d33343 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/algorithms/no-repeats-please.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/algorithms/no-repeats-please.english.md @@ -22,25 +22,25 @@ Remember to use permAlone("aab") should return a number.'');' + testString: 'assert.isNumber(permAlone("aab"), "permAlone("aab") should return a number.");' - text: permAlone("aab") should return 2. - testString: 'assert.strictEqual(permAlone(''aab''), 2, ''permAlone("aab") should return 2.'');' + testString: 'assert.strictEqual(permAlone("aab"), 2, "permAlone("aab") should return 2.");' - text: permAlone("aaa") should return 0. - testString: 'assert.strictEqual(permAlone(''aaa''), 0, ''permAlone("aaa") should return 0.'');' + testString: 'assert.strictEqual(permAlone("aaa"), 0, "permAlone("aaa") should return 0.");' - text: permAlone("aabb") should return 8. - testString: 'assert.strictEqual(permAlone(''aabb''), 8, ''permAlone("aabb") should return 8.'');' + testString: 'assert.strictEqual(permAlone("aabb"), 8, "permAlone("aabb") should return 8.");' - text: permAlone("abcdefa") should return 3600. - testString: 'assert.strictEqual(permAlone(''abcdefa''), 3600, ''permAlone("abcdefa") should return 3600.'');' + testString: 'assert.strictEqual(permAlone("abcdefa"), 3600, "permAlone("abcdefa") should return 3600.");' - text: permAlone("abfdefa") should return 2640. - testString: 'assert.strictEqual(permAlone(''abfdefa''), 2640, ''permAlone("abfdefa") should return 2640.'');' + testString: 'assert.strictEqual(permAlone("abfdefa"), 2640, "permAlone("abfdefa") should return 2640.");' - text: permAlone("zzzzzzzz") should return 0. - testString: 'assert.strictEqual(permAlone(''zzzzzzzz''), 0, ''permAlone("zzzzzzzz") should return 0.'');' + testString: 'assert.strictEqual(permAlone("zzzzzzzz"), 0, "permAlone("zzzzzzzz") should return 0.");' - text: permAlone("a") should return 1. - testString: 'assert.strictEqual(permAlone(''a''), 1, ''permAlone("a") should return 1.'');' + testString: 'assert.strictEqual(permAlone("a"), 1, "permAlone("a") should return 1.");' - text: permAlone("aaab") should return 0. - testString: 'assert.strictEqual(permAlone(''aaab''), 0, ''permAlone("aaab") should return 0.'');' + testString: 'assert.strictEqual(permAlone("aaab"), 0, "permAlone("aaab") should return 0.");' - text: permAlone("aaabb") should return 12. - testString: 'assert.strictEqual(permAlone(''aaabb''), 12, ''permAlone("aaabb") should return 12.'');' + testString: 'assert.strictEqual(permAlone("aaabb"), 12, "permAlone("aaabb") should return 12.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/algorithms/pairwise.english.md b/curriculum/challenges/english/08-coding-interview-prep/algorithms/pairwise.english.md index 459a052133..a8ce616dad 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/algorithms/pairwise.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/algorithms/pairwise.english.md @@ -26,15 +26,15 @@ Remember to use pairwise([1, 4, 2, 3, 0, 5], 7) should return 11.' - testString: 'assert.deepEqual(pairwise([1, 4, 2, 3, 0, 5], 7), 11, ''pairwise([1, 4, 2, 3, 0, 5], 7) should return 11.'');' + testString: 'assert.deepEqual(pairwise([1, 4, 2, 3, 0, 5], 7), 11, "pairwise([1, 4, 2, 3, 0, 5], 7) should return 11.");' - text: 'pairwise([1, 3, 2, 4], 4) should return 1.' - testString: 'assert.deepEqual(pairwise([1, 3, 2, 4], 4), 1, ''pairwise([1, 3, 2, 4], 4) should return 1.'');' + testString: 'assert.deepEqual(pairwise([1, 3, 2, 4], 4), 1, "pairwise([1, 3, 2, 4], 4) should return 1.");' - text: 'pairwise([1, 1, 1], 2) should return 1.' - testString: 'assert.deepEqual(pairwise([1, 1, 1], 2), 1, ''pairwise([1, 1, 1], 2) should return 1.'');' + testString: 'assert.deepEqual(pairwise([1, 1, 1], 2), 1, "pairwise([1, 1, 1], 2) should return 1.");' - text: 'pairwise([0, 0, 0, 0, 1, 1], 1) should return 10.' - testString: 'assert.deepEqual(pairwise([0, 0, 0, 0, 1, 1], 1), 10, ''pairwise([0, 0, 0, 0, 1, 1], 1) should return 10.'');' + testString: 'assert.deepEqual(pairwise([0, 0, 0, 0, 1, 1], 1), 10, "pairwise([0, 0, 0, 0, 1, 1], 1) should return 10.");' - text: 'pairwise([], 100) should return 0.' - testString: 'assert.deepEqual(pairwise([], 100), 0, ''pairwise([], 100) should return 0.'');' + testString: 'assert.deepEqual(pairwise([], 100), 0, "pairwise([], 100) should return 0.");' ``` @@ -67,7 +67,7 @@ pairwise([1,4,2,3,0,5], 7); function pairwise(arr, arg) { var sum = 0; arr.forEach(function(e, i, a) { - if (e != null) { + if (e != null) { var diff = arg-e; a[i] = null; var dix = a.indexOf(diff); @@ -75,7 +75,7 @@ function pairwise(arr, arg) { sum += dix; sum += i; a[dix] = null; - } + } } }); return sum; diff --git a/curriculum/challenges/english/08-coding-interview-prep/data-structures/add-a-new-element-to-a-binary-search-tree.english.md b/curriculum/challenges/english/08-coding-interview-prep/data-structures/add-a-new-element-to-a-binary-search-tree.english.md index 10561e3c08..e52367d99a 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/data-structures/add-a-new-element-to-a-binary-search-tree.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/data-structures/add-a-new-element-to-a-binary-search-tree.english.md @@ -22,13 +22,13 @@ Hint: trees are naturally recursive data structures! ```yml tests: - text: The BinarySearchTree data structure exists. - testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== ''undefined'') { test = new BinarySearchTree() }; return (typeof test == ''object'')})(), ''The BinarySearchTree data structure exists.'');' + testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== "undefined") { test = new BinarySearchTree() }; return (typeof test == "object")})(), "The BinarySearchTree data structure exists.");' - text: The binary search tree has a method called add. - testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== ''undefined'') { test = new BinarySearchTree() } else { return false; }; return (typeof test.add == ''function'')})(), ''The binary search tree has a method called add.'');' + testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== "undefined") { test = new BinarySearchTree() } else { return false; }; return (typeof test.add == "function")})(), "The binary search tree has a method called add.");' - text: The add method adds elements according to the binary search tree rules. - testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== ''undefined'') { test = new BinarySearchTree() } else { return false; }; if (typeof test.add !== ''function'') { return false; }; test.add(4); test.add(1); test.add(7); test.add(87); test.add(34); test.add(45); test.add(73); test.add(8); const expectedResult = [ 1, 4, 7, 8, 34, 45, 73, 87 ]; const result = test.inOrder(); return (expectedResult.toString() === result.toString()); })(), ''The add method adds elements according to the binary search tree rules.'');' + testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== "undefined") { test = new BinarySearchTree() } else { return false; }; if (typeof test.add !== "function") { return false; }; test.add(4); test.add(1); test.add(7); test.add(87); test.add(34); test.add(45); test.add(73); test.add(8); const expectedResult = [ 1, 4, 7, 8, 34, 45, 73, 87 ]; const result = test.inOrder(); return (expectedResult.toString() === result.toString()); })(), "The add method adds elements according to the binary search tree rules.");' - text: Adding an element that already exists returns null - testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== ''undefined'') { test = new BinarySearchTree() } else { return false; }; if (typeof test.add !== ''function'') { return false; }; test.add(4); return test.add(4) == null; })(), ''Adding an element that already exists returns null'');' + testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== "undefined") { test = new BinarySearchTree() } else { return false; }; if (typeof test.add !== "function") { return false; }; test.add(4); return test.add(4) == null; })(), "Adding an element that already exists returns null");' ``` @@ -72,41 +72,41 @@ console.info('after the test'); ```js -function Node(value) { - this.value = value; - this.left = null; - this.right = null; - } - function BinarySearchTree() { - this.root = null; - this.add = function (element) { - let current = this.root; - if (!current) { - this.root = new Node(element) - return; - } else { - const searchTree = function (current) { - if (current.value > element) { - if (current.left) { //si existe - return searchTree(current.left) - } else { - current.left = new Node(element); - return; - } - } else if (current.value < element) { - if (current.right) { - return searchTree(current.right) - } else { - current.right = new Node(element) - return; - } - } else { - return null; - } - } - return searchTree(current); - } - } +function Node(value) { + this.value = value; + this.left = null; + this.right = null; + } + function BinarySearchTree() { + this.root = null; + this.add = function (element) { + let current = this.root; + if (!current) { + this.root = new Node(element) + return; + } else { + const searchTree = function (current) { + if (current.value > element) { + if (current.left) { //si existe + return searchTree(current.left) + } else { + current.left = new Node(element); + return; + } + } else if (current.value < element) { + if (current.right) { + return searchTree(current.right) + } else { + current.right = new Node(element) + return; + } + } else { + return null; + } + } + return searchTree(current); + } + } } ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/data-structures/add-elements-at-a-specific-index-in-a-linked-list.english.md b/curriculum/challenges/english/08-coding-interview-prep/data-structures/add-elements-at-a-specific-index-in-a-linked-list.english.md index 6c02ca8527..950352b101 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/data-structures/add-elements-at-a-specific-index-in-a-linked-list.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/data-structures/add-elements-at-a-specific-index-in-a-linked-list.english.md @@ -26,11 +26,11 @@ Remember to check if the given index is a negative or is longer than the length ```yml tests: - text: Your addAt method should reassign head to the new node when the given index is 0. - testString: 'assert((function(){var test = new LinkedList(); test.add(''cat''); test.add(''dog''); test.addAt(0,''cat''); return test.head().element === ''cat''}()), ''Your addAt method should reassign head to the new node when the given index is 0.'');' + testString: 'assert((function(){var test = new LinkedList(); test.add("cat"); test.add("dog"); test.addAt(0,"cat"); return test.head().element === "cat"}()), "Your addAt method should reassign head to the new node when the given index is 0.");' - text: Your addAt method should increase the length of the linked list by one for each new node added to the linked list. - testString: 'assert((function(){var test = new LinkedList(); test.add(''cat''); test.add(''dog''); test.addAt(0,''cat''); return test.size() === 3}()), ''Your addAt method should increase the length of the linked list by one for each new node added to the linked list.'');' + testString: 'assert((function(){var test = new LinkedList(); test.add("cat"); test.add("dog"); test.addAt(0,"cat"); return test.size() === 3}()), "Your addAt method should increase the length of the linked list by one for each new node added to the linked list.");' - text: Your addAt method should return false if a node was unable to be added. - testString: 'assert((function(){var test = new LinkedList(); test.add(''cat''); test.add(''dog''); return (test.addAt(4,''cat'') === false); }()), ''Your addAt method should return false if a node was unable to be added.'');' + testString: 'assert((function(){var test = new LinkedList(); test.add("cat"); test.add("dog"); return (test.addAt(4,"cat") === false); }()), "Your addAt method should return false if a node was unable to be added.");' ``` @@ -42,14 +42,14 @@ tests:
```js -function LinkedList() { - var length = 0; - var head = null; +function LinkedList() { + var length = 0; + var head = null; var Node = function(element){ - this.element = element; - this.next = null; - }; + this.element = element; + this.next = null; + }; this.size = function(){ return length; @@ -74,7 +74,7 @@ function LinkedList() { } length++; - }; + }; // Only change code below this line diff --git a/curriculum/challenges/english/08-coding-interview-prep/data-structures/adjacency-list.english.md b/curriculum/challenges/english/08-coding-interview-prep/data-structures/adjacency-list.english.md index ccb095c893..516892b549 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/data-structures/adjacency-list.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/data-structures/adjacency-list.english.md @@ -27,13 +27,13 @@ Create a social network as an undirected graph with 4 nodes/people named J ```yml tests: - text: undirectedAdjList should only contain four nodes. - testString: 'assert(Object.keys(undirectedAdjList).length === 4, ''undirectedAdjList should only contain four nodes.'');' + testString: 'assert(Object.keys(undirectedAdjList).length === 4, "undirectedAdjList should only contain four nodes.");' - text: There should be an edge between Jeff and James. - testString: 'assert(undirectedAdjList.James.indexOf("Jeff") !== -1 && undirectedAdjList.Jeff.indexOf("James") !== -1, ''There should be an edge between Jeff and James.'');' + testString: 'assert(undirectedAdjList.James.indexOf("Jeff") !== -1 && undirectedAdjList.Jeff.indexOf("James") !== -1, "There should be an edge between Jeff and James.");' - text: There should be an edge between Jill and Jenny. - testString: 'assert(undirectedAdjList.Jill.indexOf("Jenny") !== -1 && undirectedAdjList.Jill.indexOf("Jenny") !== -1, ''There should be an edge between Jill and Jenny.'');' + testString: 'assert(undirectedAdjList.Jill.indexOf("Jenny") !== -1 && undirectedAdjList.Jill.indexOf("Jenny") !== -1, "There should be an edge between Jill and Jenny.");' - text: There should be an edge between Jeff and Jenny. - testString: 'assert(undirectedAdjList.Jeff.indexOf("Jenny") !== -1 && undirectedAdjList.Jenny.indexOf("Jeff") !== -1, ''There should be an edge between Jeff and Jenny.'');' + testString: 'assert(undirectedAdjList.Jeff.indexOf("Jenny") !== -1 && undirectedAdjList.Jenny.indexOf("Jeff") !== -1, "There should be an edge between Jeff and Jenny.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/data-structures/adjacency-matrix.english.md b/curriculum/challenges/english/08-coding-interview-prep/data-structures/adjacency-matrix.english.md index 6713787213..9d841c7a44 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/data-structures/adjacency-matrix.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/data-structures/adjacency-matrix.english.md @@ -29,15 +29,15 @@ Create an adjacency matrix of an undirected graph with five nodes. This matrix s ```yml tests: - text: undirectedAdjList should only contain five nodes. - testString: 'assert((adjMatUndirected.length === 5) && adjMatUndirected.map(function(x) { return x.length === 5 }).reduce(function(a, b) { return a && b }) , ''undirectedAdjList should only contain five nodes.'');' + testString: 'assert((adjMatUndirected.length === 5) && adjMatUndirected.map(function(x) { return x.length === 5 }).reduce(function(a, b) { return a && b }) , "undirectedAdjList should only contain five nodes.");' - text: There should be an edge between the first and fourth node. - testString: 'assert((adjMatUndirected[0][3] === 1) && (adjMatUndirected[3][0] === 1), ''There should be an edge between the first and fourth node.'');' + testString: 'assert((adjMatUndirected[0][3] === 1) && (adjMatUndirected[3][0] === 1), "There should be an edge between the first and fourth node.");' - text: There should be an edge between the first and third node. - testString: 'assert((adjMatUndirected[0][2] === 1) && (adjMatUndirected[2][0] === 1), ''There should be an edge between the first and third node.'');' + testString: 'assert((adjMatUndirected[0][2] === 1) && (adjMatUndirected[2][0] === 1), "There should be an edge between the first and third node.");' - text: There should be an edge between the third and fifth node. - testString: 'assert((adjMatUndirected[2][4] === 1) && (adjMatUndirected[4][2] === 1), ''There should be an edge between the third and fifth node.'');' + testString: 'assert((adjMatUndirected[2][4] === 1) && (adjMatUndirected[4][2] === 1), "There should be an edge between the third and fifth node.");' - text: There should be an edge between the fourth and fifth node. - testString: 'assert((adjMatUndirected[3][4] === 1) && (adjMatUndirected[4][3] === 1), ''There should be an edge between the fourth and fifth node.'');' + testString: 'assert((adjMatUndirected[3][4] === 1) && (adjMatUndirected[4][3] === 1), "There should be an edge between the fourth and fifth node.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/data-structures/breadth-first-search.english.md b/curriculum/challenges/english/08-coding-interview-prep/data-structures/breadth-first-search.english.md index c0376a5b62..c0505133b7 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/data-structures/breadth-first-search.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/data-structures/breadth-first-search.english.md @@ -29,13 +29,13 @@ Your function will output a JavaScript object key-value pairs with the node and ```yml tests: - text: 'The input graph [[0, 1, 0, 0], [1, 0, 1, 0], [0, 1, 0, 1], [0, 0, 1, 0]] with a start node of 1 should return {0: 1, 1: 0, 2: 1, 3: 2}' - testString: 'assert((function() { var graph = [[0, 1, 0, 0], [1, 0, 1, 0], [0, 1, 0, 1], [0, 0, 1, 0]]; var results = bfs(graph, 1); return isEquivalent(results, {0: 1, 1: 0, 2: 1, 3: 2})})(), ''The input graph [[0, 1, 0, 0], [1, 0, 1, 0], [0, 1, 0, 1], [0, 0, 1, 0]] with a start node of 1 should return {0: 1, 1: 0, 2: 1, 3: 2}'');' + testString: 'assert((function() { var graph = [[0, 1, 0, 0], [1, 0, 1, 0], [0, 1, 0, 1], [0, 0, 1, 0]]; var results = bfs(graph, 1); return isEquivalent(results, {0: 1, 1: 0, 2: 1, 3: 2})})(), "The input graph [[0, 1, 0, 0], [1, 0, 1, 0], [0, 1, 0, 1], [0, 0, 1, 0]] with a start node of 1 should return {0: 1, 1: 0, 2: 1, 3: 2}");' - text: 'The input graph [[0, 1, 0, 0], [1, 0, 1, 0], [0, 1, 0, 0], [0, 0, 0, 0]] with a start node of 1 should return {0: 1, 1: 0, 2: 1, 3: Infinity}' - testString: 'assert((function() { var graph = [[0, 1, 0, 0], [1, 0, 1, 0], [0, 1, 0, 0], [0, 0, 0, 0]]; var results = bfs(graph, 1); return isEquivalent(results, {0: 1, 1: 0, 2: 1, 3: Infinity})})(), ''The input graph [[0, 1, 0, 0], [1, 0, 1, 0], [0, 1, 0, 0], [0, 0, 0, 0]] with a start node of 1 should return {0: 1, 1: 0, 2: 1, 3: Infinity}'');' + testString: 'assert((function() { var graph = [[0, 1, 0, 0], [1, 0, 1, 0], [0, 1, 0, 0], [0, 0, 0, 0]]; var results = bfs(graph, 1); return isEquivalent(results, {0: 1, 1: 0, 2: 1, 3: Infinity})})(), "The input graph [[0, 1, 0, 0], [1, 0, 1, 0], [0, 1, 0, 0], [0, 0, 0, 0]] with a start node of 1 should return {0: 1, 1: 0, 2: 1, 3: Infinity}");' - text: 'The input graph [[0, 1, 0, 0], [1, 0, 1, 0], [0, 1, 0, 1], [0, 0, 1, 0]] with a start node of 0 should return {0: 0, 1: 1, 2: 2, 3: 3}' - testString: 'assert((function() { var graph = [[0, 1, 0, 0], [1, 0, 1, 0], [0, 1, 0, 1], [0, 0, 1, 0]]; var results = bfs(graph, 0); return isEquivalent(results, {0: 0, 1: 1, 2: 2, 3: 3})})(), ''The input graph [[0, 1, 0, 0], [1, 0, 1, 0], [0, 1, 0, 1], [0, 0, 1, 0]] with a start node of 0 should return {0: 0, 1: 1, 2: 2, 3: 3}'');' + testString: 'assert((function() { var graph = [[0, 1, 0, 0], [1, 0, 1, 0], [0, 1, 0, 1], [0, 0, 1, 0]]; var results = bfs(graph, 0); return isEquivalent(results, {0: 0, 1: 1, 2: 2, 3: 3})})(), "The input graph [[0, 1, 0, 0], [1, 0, 1, 0], [0, 1, 0, 1], [0, 0, 1, 0]] with a start node of 0 should return {0: 0, 1: 1, 2: 2, 3: 3}");' - text: 'The input graph [[0, 1], [1, 0]] with a start node of 0 should return {0: 0, 1: 1}' - testString: 'assert((function() { var graph = [[0, 1], [1, 0]]; var results = bfs(graph, 0); return isEquivalent(results, {0: 0, 1: 1})})(), ''The input graph [[0, 1], [1, 0]] with a start node of 0 should return {0: 0, 1: 1}'');' + testString: 'assert((function() { var graph = [[0, 1], [1, 0]]; var results = bfs(graph, 0); return isEquivalent(results, {0: 0, 1: 1})})(), "The input graph [[0, 1], [1, 0]] with a start node of 0 should return {0: 0, 1: 1}");' ``` @@ -50,7 +50,7 @@ tests: function bfs(graph, root) { // Distance object returned var nodesLen = {}; - + return nodesLen; }; diff --git a/curriculum/challenges/english/08-coding-interview-prep/data-structures/check-if-an-element-is-present-in-a-binary-search-tree.english.md b/curriculum/challenges/english/08-coding-interview-prep/data-structures/check-if-an-element-is-present-in-a-binary-search-tree.english.md index 0dc06b777c..966b20ebb7 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/data-structures/check-if-an-element-is-present-in-a-binary-search-tree.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/data-structures/check-if-an-element-is-present-in-a-binary-search-tree.english.md @@ -22,13 +22,13 @@ Instructions: In this challenge, we will create a utility for our tree. Write a ```yml tests: - text: The BinarySearchTree data structure exists. - testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== ''undefined'') { test = new BinarySearchTree() }; return (typeof test == ''object'')})(), ''The BinarySearchTree data structure exists.'');' + testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== "undefined") { test = new BinarySearchTree() }; return (typeof test == "object")})(), "The BinarySearchTree data structure exists.");' - text: The binary search tree has a method called isPresent. - testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== ''undefined'') { test = new BinarySearchTree() } else { return false; }; return (typeof test.isPresent == ''function'')})(), ''The binary search tree has a method called isPresent.'');' + testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== "undefined") { test = new BinarySearchTree() } else { return false; }; return (typeof test.isPresent == "function")})(), "The binary search tree has a method called isPresent.");' - text: The isPresent method correctly checks for the presence or absence of elements added to the tree. - testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== ''undefined'') { test = new BinarySearchTree() } else { return false; }; if (typeof test.isPresent !== ''function'') { return false; }; test.add(4); test.add(7); test.add(411); test.add(452); return ( test.isPresent(452) && test.isPresent(411) && test.isPresent(7) && !test.isPresent(100) ); })(), ''The isPresent method correctly checks for the presence or absence of elements added to the tree.'');' + testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== "undefined") { test = new BinarySearchTree() } else { return false; }; if (typeof test.isPresent !== "function") { return false; }; test.add(4); test.add(7); test.add(411); test.add(452); return ( test.isPresent(452) && test.isPresent(411) && test.isPresent(7) && !test.isPresent(100) ); })(), "The isPresent method correctly checks for the presence or absence of elements added to the tree.");' - text: isPresent handles cases where the tree is empty. - testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== ''undefined'') { test = new BinarySearchTree() } else { return false; }; if (typeof test.isPresent !== ''function'') { return false; }; return test.isPresent(5) == false; })(), ''isPresent handles cases where the tree is empty.'');' + testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== "undefined") { test = new BinarySearchTree() } else { return false; }; if (typeof test.isPresent !== "function") { return false; }; return test.isPresent(5) == false; })(), "isPresent handles cases where the tree is empty.");' ``` @@ -46,7 +46,7 @@ function Node(value) { this.left = null; this.right = null; } -function BinarySearchTree() { +function BinarySearchTree() { this.root = null; // change code below this line // change code above this line diff --git a/curriculum/challenges/english/08-coding-interview-prep/data-structures/create-a-circular-queue.english.md b/curriculum/challenges/english/08-coding-interview-prep/data-structures/create-a-circular-queue.english.md index eadca9966e..b01561d3d2 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/data-structures/create-a-circular-queue.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/data-structures/create-a-circular-queue.english.md @@ -32,15 +32,15 @@ In addition, the enqueue method should return the item you enqueued ```yml tests: - text: The enqueue method adds items to the circular queue. - testString: 'assert((function(){ var test = new CircularQueue(3); test.enqueue(17); test.enqueue(32); test.enqueue(591); var print = test.print(); return print[0] === 17 && print[1] === 32 && print[2] === 591; })(), ''The enqueue method adds items to the circular queue.'');' + testString: 'assert((function(){ var test = new CircularQueue(3); test.enqueue(17); test.enqueue(32); test.enqueue(591); var print = test.print(); return print[0] === 17 && print[1] === 32 && print[2] === 591; })(), "The enqueue method adds items to the circular queue.");' - text: You cannot enqueue items past the read pointer. - testString: 'assert((function(){ var test = new CircularQueue(3); test.enqueue(17); test.enqueue(32); test.enqueue(591); test.enqueue(13); test.enqueue(25); test.enqueue(59); var print = test.print(); return print[0] === 17 && print[1] === 32 && print[2] === 591; })(), ''You cannot enqueue items past the read pointer.'');' + testString: 'assert((function(){ var test = new CircularQueue(3); test.enqueue(17); test.enqueue(32); test.enqueue(591); test.enqueue(13); test.enqueue(25); test.enqueue(59); var print = test.print(); return print[0] === 17 && print[1] === 32 && print[2] === 591; })(), "You cannot enqueue items past the read pointer.");' - text: The dequeue method dequeues items from the queue. - testString: 'assert((function(){ var test = new CircularQueue(3); test.enqueue(17); test.enqueue(32); test.enqueue(591); return test.dequeue() === 17 && test.dequeue() === 32 && test.dequeue() === 591; })(), ''The dequeue method dequeues items from the queue.'');' + testString: 'assert((function(){ var test = new CircularQueue(3); test.enqueue(17); test.enqueue(32); test.enqueue(591); return test.dequeue() === 17 && test.dequeue() === 32 && test.dequeue() === 591; })(), "The dequeue method dequeues items from the queue.");' - text: After an item is dequeued its position in the queue should be reset to null. - testString: 'assert((function(){ var test = new CircularQueue(3); test.enqueue(17); test.enqueue(32); test.enqueue(672); test.dequeue(); test.dequeue(); var print = test.print(); return print[0] === null && print[1] === null && print[2] === 672; })(), ''After an item is dequeued its position in the queue should be reset to null.'');' + testString: 'assert((function(){ var test = new CircularQueue(3); test.enqueue(17); test.enqueue(32); test.enqueue(672); test.dequeue(); test.dequeue(); var print = test.print(); return print[0] === null && print[1] === null && print[2] === 672; })(), "After an item is dequeued its position in the queue should be reset to null.");' - text: Trying to dequeue past the write pointer returns null and does not advance the write pointer. - testString: 'assert((function(){ var test = new CircularQueue(3); test.enqueue(17); test.enqueue(32); test.enqueue(591); return test.dequeue() === 17 && test.dequeue() === 32 && test.dequeue() === 591 && test.dequeue() === null && test.dequeue() === null && test.dequeue() === null && test.dequeue() === null && test.enqueue(100) === 100 && test.dequeue() === 100; })(), ''Trying to dequeue past the write pointer returns null and does not advance the write pointer.'');' + testString: 'assert((function(){ var test = new CircularQueue(3); test.enqueue(17); test.enqueue(32); test.enqueue(591); return test.dequeue() === 17 && test.dequeue() === 32 && test.dequeue() === 591 && test.dequeue() === null && test.dequeue() === null && test.dequeue() === null && test.dequeue() === null && test.enqueue(100) === 100 && test.dequeue() === 100; })(), "Trying to dequeue past the write pointer returns null and does not advance the write pointer.");' ``` @@ -97,46 +97,46 @@ class CircularQueue { ```js -class CircularQueue { - constructor(size) { - this.queue = []; - this.read = 0; - this.write = 0; - this.max = size - 1; - while (size > 0) { - this.queue.push(null); - size--; - } - } - print() { - return this.queue; - } - enqueue(item) { - if (this.queue[this.write] === null) { - this.queue[this.write] = item; - if (this.write === this.max) { - this.write = 0; - } else { - this.write++; - } - return item; - } - return null; - } - dequeue() { - if (this.queue[this.read] !== null) { - var item = this.queue[this.read]; - this.queue[this.read] = null; - if (this.read === this.max) { - this.read = 0; - } else { - this.read++; - } - return item; - } else { - return null; - } - } +class CircularQueue { + constructor(size) { + this.queue = []; + this.read = 0; + this.write = 0; + this.max = size - 1; + while (size > 0) { + this.queue.push(null); + size--; + } + } + print() { + return this.queue; + } + enqueue(item) { + if (this.queue[this.write] === null) { + this.queue[this.write] = item; + if (this.write === this.max) { + this.write = 0; + } else { + this.write++; + } + return item; + } + return null; + } + dequeue() { + if (this.queue[this.read] !== null) { + var item = this.queue[this.read]; + this.queue[this.read] = null; + if (this.read === this.max) { + this.read = 0; + } else { + this.read++; + } + return item; + } else { + return null; + } + } } ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/data-structures/create-a-doubly-linked-list.english.md b/curriculum/challenges/english/08-coding-interview-prep/data-structures/create-a-doubly-linked-list.english.md index 40302b699e..c9605cb467 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/data-structures/create-a-doubly-linked-list.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/data-structures/create-a-doubly-linked-list.english.md @@ -22,21 +22,21 @@ Be careful to handle any possible edge cases when writing these methods, such as ```yml tests: - text: The DoublyLinkedList data structure exists. - testString: 'assert((function() { var test = false; if (typeof DoublyLinkedList !== ''undefined'') { test = new DoublyLinkedList() }; return (typeof test == ''object'')})(), ''The DoublyLinkedList data structure exists.'');' + testString: 'assert((function() { var test = false; if (typeof DoublyLinkedList !== "undefined") { test = new DoublyLinkedList() }; return (typeof test == "object")})(), "The DoublyLinkedList data structure exists.");' - text: The DoublyLinkedList has a method called add. - testString: 'assert((function() { var test = false; if (typeof DoublyLinkedList !== ''undefined'') { test = new DoublyLinkedList() }; if (test.add == undefined) { return false; }; return (typeof test.add == ''function'')})(), ''The DoublyLinkedList has a method called add.'');' + testString: 'assert((function() { var test = false; if (typeof DoublyLinkedList !== "undefined") { test = new DoublyLinkedList() }; if (test.add == undefined) { return false; }; return (typeof test.add == "function")})(), "The DoublyLinkedList has a method called add.");' - text: The DoublyLinkedList has a method called remove. - testString: 'assert((function() { var test = false; if (typeof DoublyLinkedList !== ''undefined'') { test = new DoublyLinkedList() }; if (test.remove == undefined) { return false; }; return (typeof test.remove == ''function'')})(), ''The DoublyLinkedList has a method called remove.'');' + testString: 'assert((function() { var test = false; if (typeof DoublyLinkedList !== "undefined") { test = new DoublyLinkedList() }; if (test.remove == undefined) { return false; }; return (typeof test.remove == "function")})(), "The DoublyLinkedList has a method called remove.");' - text: Removing an item from an empty list returns null. - testString: 'assert((function() { var test = false; if (typeof DoublyLinkedList !== ''undefined'') { test = new DoublyLinkedList() }; return (test.remove(100) == null); })(), ''Removing an item from an empty list returns null.'');' + testString: 'assert((function() { var test = false; if (typeof DoublyLinkedList !== "undefined") { test = new DoublyLinkedList() }; return (test.remove(100) == null); })(), "Removing an item from an empty list returns null.");' - text: The add method adds items to the list. - testString: 'assert((function() { var test = false; if (typeof DoublyLinkedList !== ''undefined'') { test = new DoublyLinkedList() }; test.add(5); test.add(6); test.add(723); return (test.print().join('''') == ''56723''); })(), ''The add method adds items to the list.'');' + testString: 'assert((function() { var test = false; if (typeof DoublyLinkedList !== "undefined") { test = new DoublyLinkedList() }; test.add(5); test.add(6); test.add(723); return (test.print().join("") == "56723"); })(), "The add method adds items to the list.");' - text: Each node keeps track of the previous node. - testString: 'assert((function() { var test = false; if (typeof DoublyLinkedList !== ''undefined'') { test = new DoublyLinkedList() }; test.add(50); test.add(68); test.add(73); return (test.printReverse().join('''') == ''736850''); })(), ''Each node keeps track of the previous node.'');' + testString: 'assert((function() { var test = false; if (typeof DoublyLinkedList !== "undefined") { test = new DoublyLinkedList() }; test.add(50); test.add(68); test.add(73); return (test.printReverse().join("") == "736850"); })(), "Each node keeps track of the previous node.");' - text: The first item can be removed from the list. - testString: 'assert((function() { var test = false; if (typeof DoublyLinkedList !== ''undefined'') { test = new DoublyLinkedList() }; test.add(25); test.add(35); test.add(60); test.remove(25); return ( test.print().join('''') == ''3560'' ) })(), ''The first item can be removed from the list.'');' + testString: 'assert((function() { var test = false; if (typeof DoublyLinkedList !== "undefined") { test = new DoublyLinkedList() }; test.add(25); test.add(35); test.add(60); test.remove(25); return ( test.print().join("") == "3560" ) })(), "The first item can be removed from the list.");' - text: The last item can be removed from the list. - testString: 'assert((function() { var test = false; if (typeof DoublyLinkedList !== ''undefined'') { test = new DoublyLinkedList() }; test.add(25); test.add(35); test.add(60); test.remove(60); return ( test.print().join('''') == ''2535'' ) })(), ''The last item can be removed from the list.'');' + testString: 'assert((function() { var test = false; if (typeof DoublyLinkedList !== "undefined") { test = new DoublyLinkedList() }; test.add(25); test.add(35); test.add(60); test.remove(60); return ( test.print().join("") == "2535" ) })(), "The last item can be removed from the list.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/data-structures/create-a-hash-table.english.md b/curriculum/challenges/english/08-coding-interview-prep/data-structures/create-a-hash-table.english.md index f0b059205b..f63e28c9d6 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/data-structures/create-a-hash-table.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/data-structures/create-a-hash-table.english.md @@ -24,21 +24,21 @@ Be sure to write your code to account for collisions! ```yml tests: - text: The HashTable data structure exists. - testString: 'assert((function() { var test = false; if (typeof HashTable !== ''undefined'') { test = new HashTable() }; return (typeof test === ''object'')})(), ''The HashTable data structure exists.'');' + testString: 'assert((function() { var test = false; if (typeof HashTable !== "undefined") { test = new HashTable() }; return (typeof test === "object")})(), "The HashTable data structure exists.");' - text: The HashTable has an add method. - testString: 'assert((function() { var test = false; if (typeof HashTable !== ''undefined'') { test = new HashTable() }; return ((typeof test.add) === ''function'')})(), ''The HashTable has an add method.'');' + testString: 'assert((function() { var test = false; if (typeof HashTable !== "undefined") { test = new HashTable() }; return ((typeof test.add) === "function")})(), "The HashTable has an add method.");' - text: The HashTable has an remove method. - testString: 'assert((function() { var test = false; if (typeof HashTable !== ''undefined'') { test = new HashTable() }; return ((typeof test.remove) === ''function'')})(), ''The HashTable has an remove method.'');' + testString: 'assert((function() { var test = false; if (typeof HashTable !== "undefined") { test = new HashTable() }; return ((typeof test.remove) === "function")})(), "The HashTable has an remove method.");' - text: The HashTable has an lookup method. - testString: 'assert((function() { var test = false; if (typeof HashTable !== ''undefined'') { test = new HashTable() }; return ((typeof test.lookup) === ''function'')})(), ''The HashTable has an lookup method.'');' + testString: 'assert((function() { var test = false; if (typeof HashTable !== "undefined") { test = new HashTable() }; return ((typeof test.lookup) === "function")})(), "The HashTable has an lookup method.");' - text: The add method adds key value pairs and the lookup method returns the values associated with a given key. - testString: 'assert((function() { var test = false; if (typeof HashTable !== ''undefined'') { test = new HashTable() }; test.add(''key'', ''value''); return (test.lookup(''key'') === ''value'')})(), ''The add method adds key value pairs and the lookup method returns the values associated with a given key.'');' + testString: 'assert((function() { var test = false; if (typeof HashTable !== "undefined") { test = new HashTable() }; test.add("key", "value"); return (test.lookup("key") === "value")})(), "The add method adds key value pairs and the lookup method returns the values associated with a given key.");' - text: The remove method accepts a key as input and removes the associated key value pair. - testString: 'assert((function() { var test = false; if (typeof HashTable !== ''undefined'') { test = new HashTable() }; test.add(''key'', ''value''); test.remove(''key''); return (test.lookup(''key'') === null)})(), ''The remove method accepts a key as input and removes the associated key value pair.'');' + testString: 'assert((function() { var test = false; if (typeof HashTable !== "undefined") { test = new HashTable() }; test.add("key", "value"); test.remove("key"); return (test.lookup("key") === null)})(), "The remove method accepts a key as input and removes the associated key value pair.");' - text: Items are added using the hash function. - testString: 'assert((function() { var test = false; if (typeof HashTable !== ''undefined'') { test = new HashTable() }; called = 0; test.add(''key1'',''value1''); test.add(''key2'',''value2''); test.add(''key3'',''value3''); return (called === 3)})(), ''Items are added using the hash function.'');' + testString: 'assert((function() { var test = false; if (typeof HashTable !== "undefined") { test = new HashTable() }; called = 0; test.add("key1","value1"); test.add("key2","value2"); test.add("key3","value3"); return (called === 3)})(), "Items are added using the hash function.");' - text: The hash table handles collisions. - testString: 'assert((function() { var test = false; if (typeof HashTable !== ''undefined'') { test = new HashTable() }; called = 0; test.add(''key1'',''value1''); test.add(''1key'',''value2''); test.add(''ke1y'',''value3''); return (test.lookup(''key1'') === ''value1'' && test.lookup(''1key'') == ''value2'' && test.lookup(''ke1y'') == ''value3'')})(), ''The hash table handles collisions.'');' + testString: 'assert((function() { var test = false; if (typeof HashTable !== "undefined") { test = new HashTable() }; called = 0; test.add("key1","value1"); test.add("1key","value2"); test.add("ke1y","value3"); return (test.lookup("key1") === "value1" && test.lookup("1key") == "value2" && test.lookup("ke1y") == "value3")})(), "The hash table handles collisions.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/data-structures/create-a-linked-list-class.english.md b/curriculum/challenges/english/08-coding-interview-prep/data-structures/create-a-linked-list-class.english.md index abb7bf7ce1..868144b7da 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/data-structures/create-a-linked-list-class.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/data-structures/create-a-linked-list-class.english.md @@ -25,13 +25,13 @@ Your list's length should increase by one every time an element is ```yml tests: - text: Your LinkedList class should have a add method. - testString: 'assert((function(){var test = new LinkedList(); return (typeof test.add === ''function'')}()), ''Your LinkedList class should have a add method.'');' + testString: 'assert((function(){var test = new LinkedList(); return (typeof test.add === "function")}()), "Your LinkedList class should have a add method.");' - text: Your LinkedList class should assign head to the first node added. - testString: 'assert((function(){var test = new LinkedList(); test.add(''cat''); return test.head().element === ''cat''}()), ''Your LinkedList class should assign head to the first node added.'');' + testString: 'assert((function(){var test = new LinkedList(); test.add("cat"); return test.head().element === "cat"}()), "Your LinkedList class should assign head to the first node added.");' - text: The previous node in your LinkedList class should have reference to the newest node created. - testString: 'assert((function(){var test = new LinkedList(); test.add(''cat''); test.add(''dog''); return test.head().next.element === ''dog''}()), ''The previous node in your LinkedList class should have reference to the newest node created.'');' + testString: 'assert((function(){var test = new LinkedList(); test.add("cat"); test.add("dog"); return test.head().next.element === "dog"}()), "The previous node in your LinkedList class should have reference to the newest node created.");' - text: The size of your LinkedList class should equal the amount of nodes in the linked list. - testString: 'assert((function(){var test = new LinkedList(); test.add(''cat''); test.add(''dog''); return test.size() === 2}()), ''The size of your LinkedList class should equal the amount of nodes in the linked list.'');' + testString: 'assert((function(){var test = new LinkedList(); test.add("cat"); test.add("dog"); return test.size() === 2}()), "The size of your LinkedList class should equal the amount of nodes in the linked list.");' ``` @@ -43,14 +43,14 @@ tests:
```js -function LinkedList() { - var length = 0; - var head = null; +function LinkedList() { + var length = 0; + var head = null; var Node = function(element){ - this.element = element; - this.next = null; - }; + this.element = element; + this.next = null; + }; this.head = function(){ return head; diff --git a/curriculum/challenges/english/08-coding-interview-prep/data-structures/create-a-map-data-structure.english.md b/curriculum/challenges/english/08-coding-interview-prep/data-structures/create-a-map-data-structure.english.md index 4fe0db0e7f..100beb8ff3 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/data-structures/create-a-map-data-structure.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/data-structures/create-a-map-data-structure.english.md @@ -31,19 +31,19 @@ Use the Map object provided here as a wrapper around a JavaScript < ```yml tests: - text: The Map data structure exists. - testString: 'assert((function() { var test = false; if (typeof Map !== ''undefined'') { test = new Map() }; return (typeof test == ''object'')})(), ''The Map data structure exists.'');' + testString: 'assert((function() { var test = false; if (typeof Map !== "undefined") { test = new Map() }; return (typeof test == "object")})(), "The Map data structure exists.");' - text: 'The Map object has the following methods: add, remove, get, has, values, clear, and size.' - testString: 'assert((function() { var test = false; if (typeof Map !== ''undefined'') { test = new Map() }; return (typeof test.add == ''function'' && typeof test.remove == ''function'' && typeof test.get == ''function'' && typeof test.has == ''function'' && typeof test.values == ''function'' && typeof test.clear == ''function'' && typeof test.size == ''function'')})(), ''The Map object has the following methods: add, remove, get, has, values, clear, and size.'');' + testString: 'assert((function() { var test = false; if (typeof Map !== "undefined") { test = new Map() }; return (typeof test.add == "function" && typeof test.remove == "function" && typeof test.get == "function" && typeof test.has == "function" && typeof test.values == "function" && typeof test.clear == "function" && typeof test.size == "function")})(), "The Map object has the following methods: add, remove, get, has, values, clear, and size.");' - text: The add method adds items to the map. - testString: 'assert((function() { var test = false; if (typeof Map !== ''undefined'') { test = new Map() }; test.add(5,6); test.add(2,3); test.add(2,5); return (test.size() == 2)})(), ''The add method adds items to the map.'');' + testString: 'assert((function() { var test = false; if (typeof Map !== "undefined") { test = new Map() }; test.add(5,6); test.add(2,3); test.add(2,5); return (test.size() == 2)})(), "The add method adds items to the map.");' - text: The has method returns true for added items and false for absent items. - testString: 'assert((function() { var test = false; if (typeof Map !== ''undefined'') { test = new Map() }; test.add(''test'',''value''); return (test.has(''test'') && !test.has(''false''))})(), ''The has method returns true for added items and false for absent items.'');' + testString: 'assert((function() { var test = false; if (typeof Map !== "undefined") { test = new Map() }; test.add("test","value"); return (test.has("test") && !test.has("false"))})(), "The has method returns true for added items and false for absent items.");' - text: The get method accepts keys as input and returns the associated values. - testString: 'assert((function() { var test = false; if (typeof Map !== ''undefined'') { test = new Map() }; test.add(''abc'',''def''); return (test.get(''abc'') == ''def'')})(), ''The get method accepts keys as input and returns the associated values.'');' + testString: 'assert((function() { var test = false; if (typeof Map !== "undefined") { test = new Map() }; test.add("abc","def"); return (test.get("abc") == "def")})(), "The get method accepts keys as input and returns the associated values.");' - text: The values method returns all the values stored in the map as strings in an array. - testString: 'assert((function() { var test = false; if (typeof Map !== ''undefined'') { test = new Map() }; test.add(''a'',''b''); test.add(''c'',''d''); test.add(''e'',''f''); var vals = test.values(); return (vals.indexOf(''b'') != -1 && vals.indexOf(''d'') != -1 && vals.indexOf(''f'') != -1)})(), ''The values method returns all the values stored in the map as strings in an array.'');' + testString: 'assert((function() { var test = false; if (typeof Map !== "undefined") { test = new Map() }; test.add("a","b"); test.add("c","d"); test.add("e","f"); var vals = test.values(); return (vals.indexOf("b") != -1 && vals.indexOf("d") != -1 && vals.indexOf("f") != -1)})(), "The values method returns all the values stored in the map as strings in an array.");' - text: The clear method empties the map and the size method returns the number of items present in the map. - testString: 'assert((function() { var test = false; if (typeof Map !== ''undefined'') { test = new Map() }; test.add(''b'',''b''); test.add(''c'',''d''); test.remove(''asdfas''); var init = test.size(); test.clear(); return (init == 2 && test.size() == 0)})(), ''The clear method empties the map and the size method returns the number of items present in the map.'');' + testString: 'assert((function() { var test = false; if (typeof Map !== "undefined") { test = new Map() }; test.add("b","b"); test.add("c","d"); test.remove("asdfas"); var init = test.size(); test.clear(); return (init == 2 && test.size() == 0)})(), "The clear method empties the map and the size method returns the number of items present in the map.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/data-structures/create-a-priority-queue-class.english.md b/curriculum/challenges/english/08-coding-interview-prep/data-structures/create-a-priority-queue-class.english.md index 9fa588cbd4..e4a91b3ee3 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/data-structures/create-a-priority-queue-class.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/data-structures/create-a-priority-queue-class.english.md @@ -26,19 +26,19 @@ The enqueue should accept items with the format shown above ( ```yml tests: - text: Your Queue class should have a enqueue method. - testString: 'assert((function(){var test = new PriorityQueue(); return (typeof test.enqueue === ''function'')}()), ''Your Queue class should have a enqueue method.'');' + testString: 'assert((function(){var test = new PriorityQueue(); return (typeof test.enqueue === "function")}()), "Your Queue class should have a enqueue method.");' - text: Your Queue class should have a dequeue method. - testString: 'assert((function(){var test = new PriorityQueue(); return (typeof test.dequeue === ''function'')}()), ''Your Queue class should have a dequeue method.'');' + testString: 'assert((function(){var test = new PriorityQueue(); return (typeof test.dequeue === "function")}()), "Your Queue class should have a dequeue method.");' - text: Your Queue class should have a size method. - testString: 'assert((function(){var test = new PriorityQueue(); return (typeof test.size === ''function'')}()), ''Your Queue class should have a size method.'');' + testString: 'assert((function(){var test = new PriorityQueue(); return (typeof test.size === "function")}()), "Your Queue class should have a size method.");' - text: Your Queue class should have an isEmpty method. - testString: 'assert((function(){var test = new PriorityQueue(); return (typeof test.isEmpty === ''function'')}()), ''Your Queue class should have an isEmpty method.'');' + testString: 'assert((function(){var test = new PriorityQueue(); return (typeof test.isEmpty === "function")}()), "Your Queue class should have an isEmpty method.");' - text: Your PriorityQueue should correctly keep track of the current number of items using the size method as items are enqueued and dequeued. - testString: 'assert((function(){var test = new PriorityQueue(); test.enqueue([''David Brown'', 2]); test.enqueue([''Jon Snow'', 1]); var size1 = test.size(); test.dequeue(); var size2 = test.size(); test.enqueue([''A'', 3]); test.enqueue([''B'', 3]); test.enqueue([''C'', 3]); return (size1 === 2 && size2 === 1 && test.size() === 4)}()), ''Your PriorityQueue should correctly keep track of the current number of items using the size method as items are enqueued and dequeued.'');' + testString: 'assert((function(){var test = new PriorityQueue(); test.enqueue(["David Brown", 2]); test.enqueue(["Jon Snow", 1]); var size1 = test.size(); test.dequeue(); var size2 = test.size(); test.enqueue(["A", 3]); test.enqueue(["B", 3]); test.enqueue(["C", 3]); return (size1 === 2 && size2 === 1 && test.size() === 4)}()), "Your PriorityQueue should correctly keep track of the current number of items using the size method as items are enqueued and dequeued.");' - text: The isEmpty method should return true when the queue is empty. - testString: 'assert((function(){var test = new PriorityQueue(); test.enqueue([''A'', 1]); test.enqueue([''B'', 1]); test.dequeue(); var first = test.isEmpty(); test.dequeue(); return (!first && test.isEmpty()); }()), ''The isEmpty method should return true when the queue is empty.'');' + testString: 'assert((function(){var test = new PriorityQueue(); test.enqueue(["A", 1]); test.enqueue(["B", 1]); test.dequeue(); var first = test.isEmpty(); test.dequeue(); return (!first && test.isEmpty()); }()), "The isEmpty method should return true when the queue is empty.");' - text: The priority queue should return items with a higher priority before items with a lower priority and return items in first-in-first-out order otherwise. - testString: 'assert((function(){var test = new PriorityQueue(); test.enqueue([''A'', 5]); test.enqueue([''B'', 5]); test.enqueue([''C'', 5]); test.enqueue([''D'', 3]); test.enqueue([''E'', 1]); test.enqueue([''F'', 7]); var result = []; result.push(test.dequeue()); result.push(test.dequeue()); result.push(test.dequeue()); result.push(test.dequeue()); result.push(test.dequeue()); result.push(test.dequeue()); return result.join('''') === ''EDABCF'';}()), ''The priority queue should return items with a higher priority before items with a lower priority and return items in first-in-first-out order otherwise.'');' + testString: 'assert((function(){var test = new PriorityQueue(); test.enqueue(["A", 5]); test.enqueue(["B", 5]); test.enqueue(["C", 5]); test.enqueue(["D", 3]); test.enqueue(["E", 1]); test.enqueue(["F", 7]); var result = []; result.push(test.dequeue()); result.push(test.dequeue()); result.push(test.dequeue()); result.push(test.dequeue()); result.push(test.dequeue()); result.push(test.dequeue()); return result.join("") === "EDABCF";}()), "The priority queue should return items with a higher priority before items with a lower priority and return items in first-in-first-out order otherwise.");' ``` @@ -72,17 +72,17 @@ function PriorityQueue () { ```js -function PriorityQueue () { - this.collection = []; - this.printCollection = function(){ - console.log(this.collection); - }; - this.size = function() { - return this.collection.length; - }; - this.isEmpty = function() { - return this.size() > 0 ? false : true; - }; +function PriorityQueue () { + this.collection = []; + this.printCollection = function(){ + console.log(this.collection); + }; + this.size = function() { + return this.collection.length; + }; + this.isEmpty = function() { + return this.size() > 0 ? false : true; + }; this.enqueue = function (newitem) { if (this.isEmpty()) { return this.collection.push(newitem); @@ -98,14 +98,14 @@ function PriorityQueue () { this.collection.splice(found_index, 0, newitem); } this.collection = this.collection.reverse(); -}; - this.dequeue = function() { - if (!this.isEmpty()) { - return this.collection.shift()[0]; - } else { - return 'The queue is empty.' - } - }; +}; + this.dequeue = function() { + if (!this.isEmpty()) { + return this.collection.shift()[0]; + } else { + return 'The queue is empty.' + } + }; } ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/data-structures/create-a-queue-class.english.md b/curriculum/challenges/english/08-coding-interview-prep/data-structures/create-a-queue-class.english.md index 31477719d4..342eba99fe 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/data-structures/create-a-queue-class.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/data-structures/create-a-queue-class.english.md @@ -24,23 +24,23 @@ Write an enqueue method that pushes an element to the tail of the queue, a deque ```yml tests: - text: Your Queue class should have a enqueue method. - testString: 'assert((function(){var test = new Queue(); return (typeof test.enqueue === ''function'')}()), ''Your Queue class should have a enqueue method.'');' + testString: 'assert((function(){var test = new Queue(); return (typeof test.enqueue === "function")}()), "Your Queue class should have a enqueue method.");' - text: Your Queue class should have a dequeue method. - testString: 'assert((function(){var test = new Queue(); return (typeof test.dequeue === ''function'')}()), ''Your Queue class should have a dequeue method.'');' + testString: 'assert((function(){var test = new Queue(); return (typeof test.dequeue === "function")}()), "Your Queue class should have a dequeue method.");' - text: Your Queue class should have a front method. - testString: 'assert((function(){var test = new Queue(); return (typeof test.front === ''function'')}()), ''Your Queue class should have a front method.'');' + testString: 'assert((function(){var test = new Queue(); return (typeof test.front === "function")}()), "Your Queue class should have a front method.");' - text: Your Queue class should have a size method. - testString: 'assert((function(){var test = new Queue(); return (typeof test.size === ''function'')}()), ''Your Queue class should have a size method.'');' + testString: 'assert((function(){var test = new Queue(); return (typeof test.size === "function")}()), "Your Queue class should have a size method.");' - text: Your Queue class should have an isEmpty method. - testString: 'assert((function(){var test = new Queue(); return (typeof test.isEmpty === ''function'')}()), ''Your Queue class should have an isEmpty method.'');' + testString: 'assert((function(){var test = new Queue(); return (typeof test.isEmpty === "function")}()), "Your Queue class should have an isEmpty method.");' - text: The dequeue method should remove and return the front element of the queue - testString: 'assert((function(){var test = new Queue(); test.enqueue(''Smith''); return (test.dequeue() === ''Smith'')}()), ''The dequeue method should remove and return the front element of the queue'');' + testString: 'assert((function(){var test = new Queue(); test.enqueue("Smith"); return (test.dequeue() === "Smith")}()), "The dequeue method should remove and return the front element of the queue");' - text: The front method should return value of the front element of the queue - testString: 'assert((function(){var test = new Queue(); test.enqueue(''Smith''); test.enqueue(''John''); return (test.front() === ''Smith'')}()), ''The front method should return value of the front element of the queue'');' + testString: 'assert((function(){var test = new Queue(); test.enqueue("Smith"); test.enqueue("John"); return (test.front() === "Smith")}()), "The front method should return value of the front element of the queue");' - text: The size method should return the length of the queue - testString: 'assert((function(){var test = new Queue(); test.enqueue(''Smith''); return (test.size() === 1)}()), ''The size method should return the length of the queue'');' + testString: 'assert((function(){var test = new Queue(); test.enqueue("Smith"); return (test.size() === 1)}()), "The size method should return the length of the queue");' - text: The isEmpty method should return false if there are elements in the queue - testString: 'assert((function(){var test = new Queue(); test.enqueue(''Smith''); return !(test.isEmpty())}()), ''The isEmpty method should return false if there are elements in the queue'');' + testString: 'assert((function(){var test = new Queue(); test.enqueue("Smith"); return !(test.isEmpty())}()), "The isEmpty method should return false if there are elements in the queue");' ``` @@ -52,7 +52,7 @@ tests:
```js -function Queue () { +function Queue () { var collection = []; this.print = function() { console.log(collection); diff --git a/curriculum/challenges/english/08-coding-interview-prep/data-structures/create-a-set-class.english.md b/curriculum/challenges/english/08-coding-interview-prep/data-structures/create-a-set-class.english.md index c0bc39ca16..53c718568e 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/data-structures/create-a-set-class.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/data-structures/create-a-set-class.english.md @@ -25,13 +25,13 @@ The function should return true if the value is successfully added ```yml tests: - text: Your Set class should have an add method. - testString: 'assert((function(){var test = new Set(); return (typeof test.add === ''function'')}()), ''Your Set class should have an add method.'');' + testString: 'assert((function(){var test = new Set(); return (typeof test.add === "function")}()), "Your Set class should have an add method.");' - text: Your add method should not add duplicate values. - testString: 'assert((function(){var test = new Set(); test.add(''a''); test.add(''b''); test.add(''a''); var vals = test.values(); return (vals[0] === ''a'' && vals[1] === ''b'' && vals.length === 2)}()), ''Your add method should not add duplicate values.'');' + testString: 'assert((function(){var test = new Set(); test.add("a"); test.add("b"); test.add("a"); var vals = test.values(); return (vals[0] === "a" && vals[1] === "b" && vals.length === 2)}()), "Your add method should not add duplicate values.");' - text: Your add method should return true when a value has been successfully added. - testString: 'assert((function(){var test = new Set(); var result = test.add(''a''); return (result != undefined) && (result === true);}()), ''Your add method should return true when a value has been successfully added.'');' + testString: 'assert((function(){var test = new Set(); var result = test.add("a"); return (result != undefined) && (result === true);}()), "Your add method should return true when a value has been successfully added.");' - text: Your add method should return false when a duplicate value is added. - testString: 'assert((function(){var test = new Set(); test.add(''a''); var result = test.add(''a''); return (result != undefined) && (result === false);}()), ''Your add method should return false when a duplicate value is added.'');' + testString: 'assert((function(){var test = new Set(); test.add("a"); var result = test.add("a"); return (result != undefined) && (result === false);}()), "Your add method should return false when a duplicate value is added.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/data-structures/create-a-stack-class.english.md b/curriculum/challenges/english/08-coding-interview-prep/data-structures/create-a-stack-class.english.md index 05f15495c4..16351be102 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/data-structures/create-a-stack-class.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/data-structures/create-a-stack-class.english.md @@ -25,23 +25,23 @@ Normally stacks don't have this, but we've added a print helper met ```yml tests: - text: Your Stack class should have a push method. - testString: 'assert((function(){var test = new Stack(); return (typeof test.push === ''function'')}()), ''Your Stack class should have a push method.'');' + testString: 'assert((function(){var test = new Stack(); return (typeof test.push === "function")}()), "Your Stack class should have a push method.");' - text: Your Stack class should have a pop method. - testString: 'assert((function(){var test = new Stack(); return (typeof test.pop === ''function'')}()), ''Your Stack class should have a pop method.'');' + testString: 'assert((function(){var test = new Stack(); return (typeof test.pop === "function")}()), "Your Stack class should have a pop method.");' - text: Your Stack class should have a peek method. - testString: 'assert((function(){var test = new Stack(); return (typeof test.peek === ''function'')}()), ''Your Stack class should have a peek method.'');' + testString: 'assert((function(){var test = new Stack(); return (typeof test.peek === "function")}()), "Your Stack class should have a peek method.");' - text: Your Stack class should have a isEmpty method. - testString: 'assert((function(){var test = new Stack(); return (typeof test.isEmpty === ''function'')}()), ''Your Stack class should have a isEmpty method.'');' + testString: 'assert((function(){var test = new Stack(); return (typeof test.isEmpty === "function")}()), "Your Stack class should have a isEmpty method.");' - text: Your Stack class should have a clear method. - testString: 'assert((function(){var test = new Stack(); return (typeof test.clear === ''function'')}()), ''Your Stack class should have a clear method.'');' + testString: 'assert((function(){var test = new Stack(); return (typeof test.clear === "function")}()), "Your Stack class should have a clear method.");' - text: The peek method should return the top element of the stack - testString: 'assert((function(){var test = new Stack(); test.push(''CS50''); return (test.peek() === ''CS50'')}()), ''The peek method should return the top element of the stack'');' + testString: 'assert((function(){var test = new Stack(); test.push("CS50"); return (test.peek() === "CS50")}()), "The peek method should return the top element of the stack");' - text: The pop method should remove and return the top element of the stack - testString: 'assert((function(){var test = new Stack(); test.push(''CS50''); return (test.pop() === ''CS50'');}()), ''The pop method should remove and return the top element of the stack'');' + testString: 'assert((function(){var test = new Stack(); test.push("CS50"); return (test.pop() === "CS50");}()), "The pop method should remove and return the top element of the stack");' - text: The isEmpty method should return true if a stack does not contain any elements - testString: 'assert((function(){var test = new Stack(); return test.isEmpty()}()), ''The isEmpty method should return true if a stack does not contain any elements'');' + testString: 'assert((function(){var test = new Stack(); return test.isEmpty()}()), "The isEmpty method should return true if a stack does not contain any elements");' - text: The clear method should remove all element from the stack - testString: 'assert((function(){var test = new Stack(); test.push(''CS50''); test.clear(); return (test.isEmpty())}()), ''The clear method should remove all element from the stack'');' + testString: 'assert((function(){var test = new Stack(); test.push("CS50"); test.clear(); return (test.isEmpty())}()), "The clear method should remove all element from the stack");' ``` @@ -53,7 +53,7 @@ tests:
```js -function Stack() { +function Stack() { var collection = []; this.print = function() { console.log(collection); diff --git a/curriculum/challenges/english/08-coding-interview-prep/data-structures/create-a-trie-search-tree.english.md b/curriculum/challenges/english/08-coding-interview-prep/data-structures/create-a-trie-search-tree.english.md index 8006397b8f..70fd302881 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/data-structures/create-a-trie-search-tree.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/data-structures/create-a-trie-search-tree.english.md @@ -24,15 +24,15 @@ In order for us to verify that this data structure is implemented correctly, we' ```yml tests: - text: The Trie has an add method. - testString: 'assert((function testTrie() { var test = false; if (typeof Trie !== ''undefined'') { test = new Trie() } else { return false; }; return (typeof test.add == ''function'') }()), ''The Trie has an add method.'');' + testString: 'assert((function testTrie() { var test = false; if (typeof Trie !== "undefined") { test = new Trie() } else { return false; }; return (typeof test.add == "function") }()), "The Trie has an add method.");' - text: The Trie has a print method. - testString: 'assert((function testTrie() { var test = false; if (typeof Trie !== ''undefined'') { test = new Trie() } else { return false; }; return (typeof test.print == ''function'') }()), ''The Trie has a print method.'');' + testString: 'assert((function testTrie() { var test = false; if (typeof Trie !== "undefined") { test = new Trie() } else { return false; }; return (typeof test.print == "function") }()), "The Trie has a print method.");' - text: The Trie has an isWord method. - testString: 'assert((function testTrie() { var test = false; if (typeof Trie !== ''undefined'') { test = new Trie() } else { return false; }; return (typeof test.isWord == ''function'') }()), ''The Trie has an isWord method.'');' + testString: 'assert((function testTrie() { var test = false; if (typeof Trie !== "undefined") { test = new Trie() } else { return false; }; return (typeof test.isWord == "function") }()), "The Trie has an isWord method.");' - text: The print method returns all items added to the trie as strings in an array. - testString: 'assert((function testTrie() { var test = false; if (typeof Trie !== ''undefined'') { test = new Trie() } else { return false; }; test.add(''jump''); test.add(''jumps''); test.add(''jumped''); test.add(''house''); test.add(''mouse''); var added = test.print(); return (added.indexOf(''jump'') != -1 && added.indexOf(''jumps'') != -1 && added.indexOf(''jumped'') != -1 && added.indexOf(''house'') != -1 && added.indexOf(''mouse'') != -1 && added.length == 5); }()), ''The print method returns all items added to the trie as strings in an array.'');' + testString: 'assert((function testTrie() { var test = false; if (typeof Trie !== "undefined") { test = new Trie() } else { return false; }; test.add("jump"); test.add("jumps"); test.add("jumped"); test.add("house"); test.add("mouse"); var added = test.print(); return (added.indexOf("jump") != -1 && added.indexOf("jumps") != -1 && added.indexOf("jumped") != -1 && added.indexOf("house") != -1 && added.indexOf("mouse") != -1 && added.length == 5); }()), "The print method returns all items added to the trie as strings in an array.");' - text: The isWord method returns true only for words added to the trie and false for all other words. - testString: 'assert((function testTrie() { var test = false; if (typeof Trie !== ''undefined'') { test = new Trie() } else { return false; }; test.add(''hop''); test.add(''hops''); test.add(''hopped''); test.add(''hoppy''); test.add(''hope''); return (test.isWord(''hop'') && !test.isWord(''ho'') && test.isWord(''hopped'') && !test.isWord(''hopp'') && test.isWord(''hoppy'') && !test.isWord(''hoping'')); }()), ''The isWord method returns true only for words added to the trie and false for all other words.'');' + testString: 'assert((function testTrie() { var test = false; if (typeof Trie !== "undefined") { test = new Trie() } else { return false; }; test.add("hop"); test.add("hops"); test.add("hopped"); test.add("hoppy"); test.add("hope"); return (test.isWord("hop") && !test.isWord("ho") && test.isWord("hopped") && !test.isWord("hopp") && test.isWord("hoppy") && !test.isWord("hoping")); }()), "The isWord method returns true only for words added to the trie and false for all other words.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/data-structures/create-an-es6-javascript-map.english.md b/curriculum/challenges/english/08-coding-interview-prep/data-structures/create-an-es6-javascript-map.english.md index 38073a9c3f..76edddece0 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/data-structures/create-an-es6-javascript-map.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/data-structures/create-an-es6-javascript-map.english.md @@ -28,9 +28,9 @@ Instructions: Define a JavaScript Map object and assign to it a variable called ```yml tests: - text: The myMap object exists. - testString: 'assert(typeof myMap === ''object'', ''The myMap object exists.'');' + testString: 'assert(typeof myMap === "object", "The myMap object exists.");' - text: 'myMap contains the key value pair freeCodeCamp, Awesome!.' - testString: 'assert(myMap.get(''freeCodeCamp'') === ''Awesome!'', ''myMap contains the key value pair freeCodeCamp, Awesome!.'');' + testString: 'assert(myMap.get("freeCodeCamp") === "Awesome!", "myMap contains the key value pair freeCodeCamp, Awesome!.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/data-structures/create-and-add-to-sets-in-es6.english.md b/curriculum/challenges/english/08-coding-interview-prep/data-structures/create-and-add-to-sets-in-es6.english.md index 96f8a85ffa..a3dc147fb9 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/data-structures/create-and-add-to-sets-in-es6.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/data-structures/create-and-add-to-sets-in-es6.english.md @@ -30,7 +30,7 @@ For this exercise, return a set with the following values: 1, 2, 3, 'Taco' ```yml tests: - text: 'Your Set should only contain the values 1, 2, 3, Taco, Cat, Awesome.' - testString: 'assert(function(){var test = checkSet(); return (test.size == 6) && test.has(1) && test.has(2) && test.has(3) && test.has(''Taco'') && test.has(''Cat'') && test.has(''Awesome'');}, ''Your Set should only contain the values 1, 2, 3, Taco, Cat, Awesome.'');' + testString: 'assert(function(){var test = checkSet(); return (test.size == 6) && test.has(1) && test.has(2) && test.has(3) && test.has("Taco") && test.has("Cat") && test.has("Awesome");}, "Your Set should only contain the values 1, 2, 3, Taco, Cat, Awesome.");' ``` @@ -45,7 +45,7 @@ tests: function checkSet() { var set = new Set([1, 2, 3, 3, 2, 1, 2, 3, 1]); // change code below this line - + // change code above this line console.log(set); return set; diff --git a/curriculum/challenges/english/08-coding-interview-prep/data-structures/delete-a-leaf-node-in-a-binary-search-tree.english.md b/curriculum/challenges/english/08-coding-interview-prep/data-structures/delete-a-leaf-node-in-a-binary-search-tree.english.md index 51aa561dd6..87ea60e868 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/data-structures/delete-a-leaf-node-in-a-binary-search-tree.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/data-structures/delete-a-leaf-node-in-a-binary-search-tree.english.md @@ -26,15 +26,15 @@ We will handle the second and third cases in the next challenges. Good luck! ```yml tests: - text: The BinarySearchTree data structure exists. - testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== ''undefined'') { test = new BinarySearchTree() }; return (typeof test == ''object'')})(), ''The BinarySearchTree data structure exists.'');' + testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== "undefined") { test = new BinarySearchTree() }; return (typeof test == "object")})(), "The BinarySearchTree data structure exists.");' - text: The binary search tree has a method called remove. - testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== ''undefined'') { test = new BinarySearchTree() } else { return false; }; return (typeof test.remove == ''function'')})(), ''The binary search tree has a method called remove.'');' + testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== "undefined") { test = new BinarySearchTree() } else { return false; }; return (typeof test.remove == "function")})(), "The binary search tree has a method called remove.");' - text: Trying to remove an element that does not exist returns null. - testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== ''undefined'') { test = new BinarySearchTree() } else { return false; }; if (typeof test.remove !== ''function'') { return false; }; return (test.remove(100) == null); })(), ''Trying to remove an element that does not exist returns null.'');' + testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== "undefined") { test = new BinarySearchTree() } else { return false; }; if (typeof test.remove !== "function") { return false; }; return (test.remove(100) == null); })(), "Trying to remove an element that does not exist returns null.");' - text: 'If the root node has no children, deleting it sets the root to null.' - testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== ''undefined'') { test = new BinarySearchTree() } else { return false; }; if (typeof test.remove !== ''function'') { return false; }; test.add(500); test.remove(500); return (test.inorder() == null); })(), ''If the root node has no children, deleting it sets the root to null.'');' + testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== "undefined") { test = new BinarySearchTree() } else { return false; }; if (typeof test.remove !== "function") { return false; }; test.add(500); test.remove(500); return (test.inorder() == null); })(), "If the root node has no children, deleting it sets the root to null.");' - text: The remove method removes leaf nodes from the tree - testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== ''undefined'') { test = new BinarySearchTree() } else { return false; }; if (typeof test.remove !== ''function'') { return false; }; test.add(5); test.add(3); test.add(7); test.add(6); test.add(10); test.add(12); test.remove(3); test.remove(12); test.remove(10); return (test.inorder().join('''') == ''567''); })(), ''The remove method removes leaf nodes from the tree'');' + testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== "undefined") { test = new BinarySearchTree() } else { return false; }; if (typeof test.remove !== "function") { return false; }; test.add(5); test.add(3); test.add(7); test.add(6); test.add(10); test.add(12); test.remove(3); test.remove(12); test.remove(10); return (test.inorder().join("") == "567"); })(), "The remove method removes leaf nodes from the tree");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/data-structures/delete-a-node-with-one-child-in-a-binary-search-tree.english.md b/curriculum/challenges/english/08-coding-interview-prep/data-structures/delete-a-node-with-one-child-in-a-binary-search-tree.english.md index 7a33d18837..266066034f 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/data-structures/delete-a-node-with-one-child-in-a-binary-search-tree.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/data-structures/delete-a-node-with-one-child-in-a-binary-search-tree.english.md @@ -21,19 +21,19 @@ Instructions: We've provided some code in our remove method that ac ```yml tests: - text: The BinarySearchTree data structure exists. - testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== ''undefined'') { test = new BinarySearchTree() }; return (typeof test == ''object'')})(), ''The BinarySearchTree data structure exists.'');' + testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== "undefined") { test = new BinarySearchTree() }; return (typeof test == "object")})(), "The BinarySearchTree data structure exists.");' - text: The binary search tree has a method called remove. - testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== ''undefined'') { test = new BinarySearchTree() } else { return false; }; return (typeof test.remove == ''function'')})(), ''The binary search tree has a method called remove.'');' + testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== "undefined") { test = new BinarySearchTree() } else { return false; }; return (typeof test.remove == "function")})(), "The binary search tree has a method called remove.");' - text: Trying to remove an element that does not exist returns null. - testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== ''undefined'') { test = new BinarySearchTree() } else { return false; }; if (typeof test.remove !== ''function'') { return false; }; return (test.remove(100) == null); })(), ''Trying to remove an element that does not exist returns null.'');' + testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== "undefined") { test = new BinarySearchTree() } else { return false; }; if (typeof test.remove !== "function") { return false; }; return (test.remove(100) == null); })(), "Trying to remove an element that does not exist returns null.");' - text: 'If the root node has no children, deleting it sets the root to null.' - testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== ''undefined'') { test = new BinarySearchTree() } else { return false; }; if (typeof test.remove !== ''function'') { return false; }; test.add(500); test.remove(500); return (test.inorder() == null); })(), ''If the root node has no children, deleting it sets the root to null.'');' + testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== "undefined") { test = new BinarySearchTree() } else { return false; }; if (typeof test.remove !== "function") { return false; }; test.add(500); test.remove(500); return (test.inorder() == null); })(), "If the root node has no children, deleting it sets the root to null.");' - text: The remove method removes leaf nodes from the tree - testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== ''undefined'') { test = new BinarySearchTree() } else { return false; }; if (typeof test.remove !== ''function'') { return false; }; test.add(5); test.add(3); test.add(7); test.add(6); test.add(10); test.add(12); test.remove(3); test.remove(12); test.remove(10); return (test.inorder().join('''') == ''567''); })(), ''The remove method removes leaf nodes from the tree'');' + testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== "undefined") { test = new BinarySearchTree() } else { return false; }; if (typeof test.remove !== "function") { return false; }; test.add(5); test.add(3); test.add(7); test.add(6); test.add(10); test.add(12); test.remove(3); test.remove(12); test.remove(10); return (test.inorder().join("") == "567"); })(), "The remove method removes leaf nodes from the tree");' - text: The remove method removes nodes with one child. - testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== ''undefined'') { test = new BinarySearchTree() } else { return false; }; if (typeof test.remove !== ''function'') { return false; }; test.add(-1); test.add(3); test.add(7); test.add(16); test.remove(16); test.remove(7); test.remove(3); return (test.inorder().join('''') == ''-1''); })(), ''The remove method removes nodes with one child.'');' + testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== "undefined") { test = new BinarySearchTree() } else { return false; }; if (typeof test.remove !== "function") { return false; }; test.add(-1); test.add(3); test.add(7); test.add(16); test.remove(16); test.remove(7); test.remove(3); return (test.inorder().join("") == "-1"); })(), "The remove method removes nodes with one child.");' - text: Removing the root in a tree with two nodes sets the second to be the root. - testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== ''undefined'') { test = new BinarySearchTree() } else { return false; }; if (typeof test.remove !== ''function'') { return false; }; test.add(15); test.add(27); test.remove(15); return (test.inorder().join('''') == ''27''); })(), ''Removing the root in a tree with two nodes sets the second to be the root.'');' + testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== "undefined") { test = new BinarySearchTree() } else { return false; }; if (typeof test.remove !== "function") { return false; }; test.add(15); test.add(27); test.remove(15); return (test.inorder().join("") == "27"); })(), "Removing the root in a tree with two nodes sets the second to be the root.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/data-structures/delete-a-node-with-two-children-in-a-binary-search-tree.english.md b/curriculum/challenges/english/08-coding-interview-prep/data-structures/delete-a-node-with-two-children-in-a-binary-search-tree.english.md index 42f6a6a48d..5e72e2cf39 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/data-structures/delete-a-node-with-two-children-in-a-binary-search-tree.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/data-structures/delete-a-node-with-two-children-in-a-binary-search-tree.english.md @@ -22,23 +22,23 @@ Instructions: Let's finish our remove method by handling the third ```yml tests: - text: The BinarySearchTree data structure exists. - testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== ''undefined'') { test = new BinarySearchTree() }; return (typeof test == ''object'')})(), ''The BinarySearchTree data structure exists.'');' + testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== "undefined") { test = new BinarySearchTree() }; return (typeof test == "object")})(), "The BinarySearchTree data structure exists.");' - text: The binary search tree has a method called remove. - testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== ''undefined'') { test = new BinarySearchTree() } else { return false; }; return (typeof test.remove == ''function'')})(), ''The binary search tree has a method called remove.'');' + testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== "undefined") { test = new BinarySearchTree() } else { return false; }; return (typeof test.remove == "function")})(), "The binary search tree has a method called remove.");' - text: Trying to remove an element that does not exist returns null. - testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== ''undefined'') { test = new BinarySearchTree() } else { return false; }; return (typeof test.remove == ''function'') ? (test.remove(100) == null) : false})(), ''Trying to remove an element that does not exist returns null.'');' + testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== "undefined") { test = new BinarySearchTree() } else { return false; }; return (typeof test.remove == "function") ? (test.remove(100) == null) : false})(), "Trying to remove an element that does not exist returns null.");' - text: 'If the root node has no children, deleting it sets the root to null.' - testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== ''undefined'') { test = new BinarySearchTree() } else { return false; }; test.add(500); test.remove(500); return (typeof test.remove == ''function'') ? (test.inorder() == null) : false})(), ''If the root node has no children, deleting it sets the root to null.'');' + testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== "undefined") { test = new BinarySearchTree() } else { return false; }; test.add(500); test.remove(500); return (typeof test.remove == "function") ? (test.inorder() == null) : false})(), "If the root node has no children, deleting it sets the root to null.");' - text: The remove method removes leaf nodes from the tree - testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== ''undefined'') { test = new BinarySearchTree() } else { return false; }; test.add(5); test.add(3); test.add(7); test.add(6); test.add(10); test.add(12); test.remove(3); test.remove(12); test.remove(10); return (typeof test.remove == ''function'') ? (test.inorder().join('''') == ''567'') : false})(), ''The remove method removes leaf nodes from the tree'');' + testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== "undefined") { test = new BinarySearchTree() } else { return false; }; test.add(5); test.add(3); test.add(7); test.add(6); test.add(10); test.add(12); test.remove(3); test.remove(12); test.remove(10); return (typeof test.remove == "function") ? (test.inorder().join("") == "567") : false})(), "The remove method removes leaf nodes from the tree");' - text: The remove method removes nodes with one child. - testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== ''undefined'') { test = new BinarySearchTree() } else { return false; }; if (typeof test.remove !== ''function'') { return false; }; test.add(-1); test.add(3); test.add(7); test.add(16); test.remove(16); test.remove(7); test.remove(3); return (test.inorder().join('''') == ''-1''); })(), ''The remove method removes nodes with one child.'');' + testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== "undefined") { test = new BinarySearchTree() } else { return false; }; if (typeof test.remove !== "function") { return false; }; test.add(-1); test.add(3); test.add(7); test.add(16); test.remove(16); test.remove(7); test.remove(3); return (test.inorder().join("") == "-1"); })(), "The remove method removes nodes with one child.");' - text: Removing the root in a tree with two nodes sets the second to be the root. - testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== ''undefined'') { test = new BinarySearchTree() } else { return false; }; if (typeof test.remove !== ''function'') { return false; }; test.add(15); test.add(27); test.remove(15); return (test.inorder().join('''') == ''27''); })(), ''Removing the root in a tree with two nodes sets the second to be the root.'');' + testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== "undefined") { test = new BinarySearchTree() } else { return false; }; if (typeof test.remove !== "function") { return false; }; test.add(15); test.add(27); test.remove(15); return (test.inorder().join("") == "27"); })(), "Removing the root in a tree with two nodes sets the second to be the root.");' - text: The remove method removes nodes with two children while maintaining the binary search tree structure. - testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== ''undefined'') { test = new BinarySearchTree() } else { return false; }; if (typeof test.remove !== ''function'') { return false; }; test.add(1); test.add(4); test.add(3); test.add(7); test.add(9); test.add(11); test.add(14); test.add(15); test.add(19); test.add(50); test.remove(9); if (!test.isBinarySearchTree()) { return false; }; test.remove(11); if (!test.isBinarySearchTree()) { return false; }; test.remove(14); if (!test.isBinarySearchTree()) { return false; }; test.remove(19); if (!test.isBinarySearchTree()) { return false; }; test.remove(3); if (!test.isBinarySearchTree()) { return false; }; test.remove(50); if (!test.isBinarySearchTree()) { return false; }; test.remove(15); if (!test.isBinarySearchTree()) { return false; }; return (test.inorder().join('''') == ''147''); })(), ''The remove method removes nodes with two children while maintaining the binary search tree structure.'');' + testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== "undefined") { test = new BinarySearchTree() } else { return false; }; if (typeof test.remove !== "function") { return false; }; test.add(1); test.add(4); test.add(3); test.add(7); test.add(9); test.add(11); test.add(14); test.add(15); test.add(19); test.add(50); test.remove(9); if (!test.isBinarySearchTree()) { return false; }; test.remove(11); if (!test.isBinarySearchTree()) { return false; }; test.remove(14); if (!test.isBinarySearchTree()) { return false; }; test.remove(19); if (!test.isBinarySearchTree()) { return false; }; test.remove(3); if (!test.isBinarySearchTree()) { return false; }; test.remove(50); if (!test.isBinarySearchTree()) { return false; }; test.remove(15); if (!test.isBinarySearchTree()) { return false; }; return (test.inorder().join("") == "147"); })(), "The remove method removes nodes with two children while maintaining the binary search tree structure.");' - text: The root can be removed on a tree of three nodes. - testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== ''undefined'') { test = new BinarySearchTree() } else { return false; }; if (typeof test.remove !== ''function'') { return false; }; test.add(100); test.add(50); test.add(300); test.remove(100); return (test.inorder().join('''') == 50300); })(), ''The root can be removed on a tree of three nodes.'');' + testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== "undefined") { test = new BinarySearchTree() } else { return false; }; if (typeof test.remove !== "function") { return false; }; test.add(100); test.add(50); test.add(300); test.remove(100); return (test.inorder().join("") == 50300); })(), "The root can be removed on a tree of three nodes.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/data-structures/depth-first-search.english.md b/curriculum/challenges/english/08-coding-interview-prep/data-structures/depth-first-search.english.md index 227e494b7c..9b94483f61 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/data-structures/depth-first-search.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/data-structures/depth-first-search.english.md @@ -26,21 +26,21 @@ Your function should output an array of all nodes reachable from root[[0, 1, 0, 0], [1, 0, 1, 0], [0, 1, 0, 1], [0, 0, 1, 0]] with a start node of 1 should return an array with 0, 1, 2, and 3.' - testString: 'assert.sameMembers((function() { var graph = [[0, 1, 0, 0], [1, 0, 1, 0], [0, 1, 0, 1], [0, 0, 1, 0]]; return dfs(graph, 1);})(), [0, 1, 2, 3], ''The input graph [[0, 1, 0, 0], [1, 0, 1, 0], [0, 1, 0, 1], [0, 0, 1, 0]] with a start node of 1 should return an array with 0, 1, 2, and 3.'');' + testString: 'assert.sameMembers((function() { var graph = [[0, 1, 0, 0], [1, 0, 1, 0], [0, 1, 0, 1], [0, 0, 1, 0]]; return dfs(graph, 1);})(), [0, 1, 2, 3], "The input graph [[0, 1, 0, 0], [1, 0, 1, 0], [0, 1, 0, 1], [0, 0, 1, 0]] with a start node of 1 should return an array with 0, 1, 2, and 3.");' - text: 'The input graph [[0, 1, 0, 0], [1, 0, 1, 0], [0, 1, 0, 1], [0, 0, 1, 0]] with a start node of 1 should return an array with four elements.' - testString: 'assert((function() { var graph = [[0, 1, 0, 0], [1, 0, 1, 0], [0, 1, 0, 1], [0, 0, 1, 0]]; return dfs(graph, 1);})().length === 4, ''The input graph [[0, 1, 0, 0], [1, 0, 1, 0], [0, 1, 0, 1], [0, 0, 1, 0]] with a start node of 1 should return an array with four elements.'');' + testString: 'assert((function() { var graph = [[0, 1, 0, 0], [1, 0, 1, 0], [0, 1, 0, 1], [0, 0, 1, 0]]; return dfs(graph, 1);})().length === 4, "The input graph [[0, 1, 0, 0], [1, 0, 1, 0], [0, 1, 0, 1], [0, 0, 1, 0]] with a start node of 1 should return an array with four elements.");' - text: 'The input graph [[0, 1, 0, 0], [1, 0, 1, 0], [0, 1, 0, 0], [0, 0, 0, 0]] with a start node of 3 should return an array with 3.' - testString: 'assert.sameMembers((function() { var graph = [[0, 1, 0, 0], [1, 0, 1, 0], [0, 1, 0, 0], [0, 0, 0, 0]]; return dfs(graph, 3);})(), [3], ''The input graph [[0, 1, 0, 0], [1, 0, 1, 0], [0, 1, 0, 0], [0, 0, 0, 0]] with a start node of 3 should return an array with 3.'');' + testString: 'assert.sameMembers((function() { var graph = [[0, 1, 0, 0], [1, 0, 1, 0], [0, 1, 0, 0], [0, 0, 0, 0]]; return dfs(graph, 3);})(), [3], "The input graph [[0, 1, 0, 0], [1, 0, 1, 0], [0, 1, 0, 0], [0, 0, 0, 0]] with a start node of 3 should return an array with 3.");' - text: 'The input graph [[0, 1, 0, 0], [1, 0, 1, 0], [0, 1, 0, 0], [0, 0, 0, 0]] with a start node of 3 should return an array with one element.' - testString: 'assert((function() { var graph = [[0, 1, 0, 0], [1, 0, 1, 0], [0, 1, 0, 0], [0, 0, 0, 0]]; return dfs(graph, 3);})().length === 1, ''The input graph [[0, 1, 0, 0], [1, 0, 1, 0], [0, 1, 0, 0], [0, 0, 0, 0]] with a start node of 3 should return an array with one element.'');' + testString: 'assert((function() { var graph = [[0, 1, 0, 0], [1, 0, 1, 0], [0, 1, 0, 0], [0, 0, 0, 0]]; return dfs(graph, 3);})().length === 1, "The input graph [[0, 1, 0, 0], [1, 0, 1, 0], [0, 1, 0, 0], [0, 0, 0, 0]] with a start node of 3 should return an array with one element.");' - text: 'The input graph [[0, 1, 0, 0], [1, 0, 0, 0], [0, 0, 0, 1], [0, 0, 1, 0]] with a start node of 3 should return an array with 2 and 3.' - testString: 'assert.sameMembers((function() { var graph = [[0, 1, 0, 0], [1, 0, 0, 0], [0, 0, 0, 1], [0, 0, 1, 0]]; return dfs(graph, 3);})(), [2, 3], ''The input graph [[0, 1, 0, 0], [1, 0, 0, 0], [0, 0, 0, 1], [0, 0, 1, 0]] with a start node of 3 should return an array with 2 and 3.'');' + testString: 'assert.sameMembers((function() { var graph = [[0, 1, 0, 0], [1, 0, 0, 0], [0, 0, 0, 1], [0, 0, 1, 0]]; return dfs(graph, 3);})(), [2, 3], "The input graph [[0, 1, 0, 0], [1, 0, 0, 0], [0, 0, 0, 1], [0, 0, 1, 0]] with a start node of 3 should return an array with 2 and 3.");' - text: 'The input graph [[0, 1, 0, 0], [1, 0, 0, 0], [0, 0, 0, 1], [0, 0, 1, 0]] with a start node of 3 should return an array with two elements.' - testString: 'assert((function() { var graph = [[0, 1, 0, 0], [1, 0, 0, 0], [0, 0, 0, 1], [0, 0, 1, 0]]; return dfs(graph, 3);})().length === 2, ''The input graph [[0, 1, 0, 0], [1, 0, 0, 0], [0, 0, 0, 1], [0, 0, 1, 0]] with a start node of 3 should return an array with two elements.'');' + testString: 'assert((function() { var graph = [[0, 1, 0, 0], [1, 0, 0, 0], [0, 0, 0, 1], [0, 0, 1, 0]]; return dfs(graph, 3);})().length === 2, "The input graph [[0, 1, 0, 0], [1, 0, 0, 0], [0, 0, 0, 1], [0, 0, 1, 0]] with a start node of 3 should return an array with two elements.");' - text: 'The input graph [[0, 1, 0, 0], [1, 0, 0, 0], [0, 0, 0, 1], [0, 0, 1, 0]] with a start node of 0 should return an array with 0 and 1.' - testString: 'assert.sameMembers((function() { var graph = [[0, 1, 0, 0], [1, 0, 0, 0], [0, 0, 0, 1], [0, 0, 1, 0]]; return dfs(graph, 0);})(), [0, 1], ''The input graph [[0, 1, 0, 0], [1, 0, 0, 0], [0, 0, 0, 1], [0, 0, 1, 0]] with a start node of 0 should return an array with 0 and 1.'');' + testString: 'assert.sameMembers((function() { var graph = [[0, 1, 0, 0], [1, 0, 0, 0], [0, 0, 0, 1], [0, 0, 1, 0]]; return dfs(graph, 0);})(), [0, 1], "The input graph [[0, 1, 0, 0], [1, 0, 0, 0], [0, 0, 0, 1], [0, 0, 1, 0]] with a start node of 0 should return an array with 0 and 1.");' - text: 'The input graph [[0, 1, 0, 0], [1, 0, 0, 0], [0, 0, 0, 1], [0, 0, 1, 0]] with a start node of 0 should return an array with two elements.' - testString: 'assert((function() { var graph = [[0, 1, 0, 0], [1, 0, 0, 0], [0, 0, 0, 1], [0, 0, 1, 0]]; return dfs(graph, 0);})().length === 2, ''The input graph [[0, 1, 0, 0], [1, 0, 0, 0], [0, 0, 0, 1], [0, 0, 1, 0]] with a start node of 0 should return an array with two elements.'');' + testString: 'assert((function() { var graph = [[0, 1, 0, 0], [1, 0, 0, 0], [0, 0, 0, 1], [0, 0, 1, 0]]; return dfs(graph, 0);})().length === 2, "The input graph [[0, 1, 0, 0], [1, 0, 0, 0], [0, 0, 0, 1], [0, 0, 1, 0]] with a start node of 0 should return an array with two elements.");' ``` @@ -53,7 +53,7 @@ tests: ```js function dfs(graph, root) { - + } var exDFSGraph = [ diff --git a/curriculum/challenges/english/08-coding-interview-prep/data-structures/find-the-minimum-and-maximum-height-of-a-binary-search-tree.english.md b/curriculum/challenges/english/08-coding-interview-prep/data-structures/find-the-minimum-and-maximum-height-of-a-binary-search-tree.english.md index 1da8d9af15..e9cb2a4bc2 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/data-structures/find-the-minimum-and-maximum-height-of-a-binary-search-tree.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/data-structures/find-the-minimum-and-maximum-height-of-a-binary-search-tree.english.md @@ -23,21 +23,21 @@ Instructions: Write two methods for our binary tree: findMinHeight ```yml tests: - text: The BinarySearchTree data structure exists. - testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== ''undefined'') { test = new BinarySearchTree() }; return (typeof test == ''object'')})(), ''The BinarySearchTree data structure exists.'');' + testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== "undefined") { test = new BinarySearchTree() }; return (typeof test == "object")})(), "The BinarySearchTree data structure exists.");' - text: The binary search tree has a method called findMinHeight. - testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== ''undefined'') { test = new BinarySearchTree() } else { return false; }; return (typeof test.findMinHeight == ''function'')})(), ''The binary search tree has a method called findMinHeight.'');' + testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== "undefined") { test = new BinarySearchTree() } else { return false; }; return (typeof test.findMinHeight == "function")})(), "The binary search tree has a method called findMinHeight.");' - text: The binary search tree has a method called findMaxHeight. - testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== ''undefined'') { test = new BinarySearchTree() } else { return false; }; return (typeof test.findMaxHeight == ''function'')})(), ''The binary search tree has a method called findMaxHeight.'');' + testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== "undefined") { test = new BinarySearchTree() } else { return false; }; return (typeof test.findMaxHeight == "function")})(), "The binary search tree has a method called findMaxHeight.");' - text: The binary search tree has a method called isBalanced. - testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== ''undefined'') { test = new BinarySearchTree() } else { return false; }; return (typeof test.isBalanced == ''function'')})(), ''The binary search tree has a method called isBalanced.'');' + testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== "undefined") { test = new BinarySearchTree() } else { return false; }; return (typeof test.isBalanced == "function")})(), "The binary search tree has a method called isBalanced.");' - text: The findMinHeight method returns the minimum height of the tree. - testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== ''undefined'') { test = new BinarySearchTree() } else { return false; }; if (typeof test.findMinHeight !== ''function'') { return false; }; test.add(4); test.add(1); test.add(7); test.add(87); test.add(34); test.add(45); test.add(73); test.add(8); return (test.findMinHeight() == 1); })(), ''The findMinHeight method returns the minimum height of the tree.'');' + testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== "undefined") { test = new BinarySearchTree() } else { return false; }; if (typeof test.findMinHeight !== "function") { return false; }; test.add(4); test.add(1); test.add(7); test.add(87); test.add(34); test.add(45); test.add(73); test.add(8); return (test.findMinHeight() == 1); })(), "The findMinHeight method returns the minimum height of the tree.");' - text: The findMaxHeight method returns the maximum height of the tree. - testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== ''undefined'') { test = new BinarySearchTree() } else { return false; }; if (typeof test.findMaxHeight !== ''function'') { return false; }; test.add(4); test.add(1); test.add(7); test.add(87); test.add(34); test.add(45); test.add(73); test.add(8); return (test.findMaxHeight() == 5); })(), ''The findMaxHeight method returns the maximum height of the tree.'');' + testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== "undefined") { test = new BinarySearchTree() } else { return false; }; if (typeof test.findMaxHeight !== "function") { return false; }; test.add(4); test.add(1); test.add(7); test.add(87); test.add(34); test.add(45); test.add(73); test.add(8); return (test.findMaxHeight() == 5); })(), "The findMaxHeight method returns the maximum height of the tree.");' - text: An empty tree returns a height of -1. - testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== ''undefined'') { test = new BinarySearchTree() } else { return false; }; if (typeof test.findMaxHeight !== ''function'') { return false; }; return (test.findMaxHeight() == -1); })(), ''An empty tree returns a height of -1.'');' + testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== "undefined") { test = new BinarySearchTree() } else { return false; }; if (typeof test.findMaxHeight !== "function") { return false; }; return (test.findMaxHeight() == -1); })(), "An empty tree returns a height of -1.");' - text: The isBalanced method returns true if the tree is a balanced binary search tree. - testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== ''undefined'') { test = new BinarySearchTree() } else { return false; }; if (typeof test.isBalanced !== ''function'') { return false; }; test.add(4); test.add(1); test.add(7); test.add(87); test.add(34); test.add(45); test.add(73); test.add(8); return test.isBalanced(); })(), ''The isBalanced method returns true if the tree is a balanced binary search tree.'');' + testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== "undefined") { test = new BinarySearchTree() } else { return false; }; if (typeof test.isBalanced !== "function") { return false; }; test.add(4); test.add(1); test.add(7); test.add(87); test.add(34); test.add(45); test.add(73); test.add(8); return test.isBalanced(); })(), "The isBalanced method returns true if the tree is a balanced binary search tree.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/data-structures/find-the-minimum-and-maximum-value-in-a-binary-search-tree.english.md b/curriculum/challenges/english/08-coding-interview-prep/data-structures/find-the-minimum-and-maximum-value-in-a-binary-search-tree.english.md index da6dc739b7..04206d5f48 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/data-structures/find-the-minimum-and-maximum-value-in-a-binary-search-tree.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/data-structures/find-the-minimum-and-maximum-value-in-a-binary-search-tree.english.md @@ -26,17 +26,17 @@ Instructions: We'll start simple. We've defined the skeleton of a binary search ```yml tests: - text: The BinarySearchTree data structure exists. - testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== ''undefined'') { test = new BinarySearchTree() }; return (typeof test == ''object'')})(), ''The BinarySearchTree data structure exists.'');' + testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== "undefined") { test = new BinarySearchTree() }; return (typeof test == "object")})(), "The BinarySearchTree data structure exists.");' - text: The binary search tree has a method called findMin. - testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== ''undefined'') { test = new BinarySearchTree() } else { return false; }; return (typeof test.findMin == ''function'')})(), ''The binary search tree has a method called findMin.'');' + testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== "undefined") { test = new BinarySearchTree() } else { return false; }; return (typeof test.findMin == "function")})(), "The binary search tree has a method called findMin.");' - text: The binary search tree has a method called findMax. - testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== ''undefined'') { test = new BinarySearchTree() } else { return false; }; return (typeof test.findMax == ''function'')})(), ''The binary search tree has a method called findMax.'');' + testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== "undefined") { test = new BinarySearchTree() } else { return false; }; return (typeof test.findMax == "function")})(), "The binary search tree has a method called findMax.");' - text: The findMin method returns the minimum value in the binary search tree. - testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== ''undefined'') { test = new BinarySearchTree() } else { return false; }; if (typeof test.findMin !== ''function'') { return false; }; test.add(4); test.add(1); test.add(7); test.add(87); test.add(34); test.add(45); test.add(73); test.add(8); return test.findMin() == 1; })(), ''The findMin method returns the minimum value in the binary search tree.'');' + testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== "undefined") { test = new BinarySearchTree() } else { return false; }; if (typeof test.findMin !== "function") { return false; }; test.add(4); test.add(1); test.add(7); test.add(87); test.add(34); test.add(45); test.add(73); test.add(8); return test.findMin() == 1; })(), "The findMin method returns the minimum value in the binary search tree.");' - text: The findMax method returns the maximum value in the binary search tree. - testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== ''undefined'') { test = new BinarySearchTree() } else { return false; }; if (typeof test.findMax !== ''function'') { return false; }; test.add(4); test.add(1); test.add(7); test.add(87); test.add(34); test.add(45); test.add(73); test.add(8); return test.findMax() == 87; })(), ''The findMax method returns the maximum value in the binary search tree.'');' + testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== "undefined") { test = new BinarySearchTree() } else { return false; }; if (typeof test.findMax !== "function") { return false; }; test.add(4); test.add(1); test.add(7); test.add(87); test.add(34); test.add(45); test.add(73); test.add(8); return test.findMax() == 87; })(), "The findMax method returns the maximum value in the binary search tree.");' - text: The findMin and findMax methods return null for an empty tree. - testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== ''undefined'') { test = new BinarySearchTree() } else { return false; }; if (typeof test.findMin !== ''function'') { return false; }; if (typeof test.findMax !== ''function'') { return false; }; return (test.findMin() == null && test.findMax() == null) })(), ''The findMin and findMax methods return null for an empty tree.'');' + testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== "undefined") { test = new BinarySearchTree() } else { return false; }; if (typeof test.findMin !== "function") { return false; }; if (typeof test.findMax !== "function") { return false; }; return (test.findMin() == null && test.findMax() == null) })(), "The findMin and findMax methods return null for an empty tree.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/data-structures/implement-heap-sort-with-a-min-heap.english.md b/curriculum/challenges/english/08-coding-interview-prep/data-structures/implement-heap-sort-with-a-min-heap.english.md index dcbdf14d8b..eb69fe90c4 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/data-structures/implement-heap-sort-with-a-min-heap.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/data-structures/implement-heap-sort-with-a-min-heap.english.md @@ -22,15 +22,15 @@ Instructions: Let's implement heap sort with a min heap. Feel free to adapt your ```yml tests: - text: The MinHeap data structure exists. - testString: 'assert((function() { var test = false; if (typeof MinHeap !== ''undefined'') { test = new MinHeap() }; return (typeof test == ''object'')})(), ''The MinHeap data structure exists.'');' + testString: 'assert((function() { var test = false; if (typeof MinHeap !== "undefined") { test = new MinHeap() }; return (typeof test == "object")})(), "The MinHeap data structure exists.");' - text: MinHeap has a method called insert. - testString: 'assert((function() { var test = false; if (typeof MinHeap !== ''undefined'') { test = new MinHeap() } else { return false; }; return (typeof test.insert == ''function'')})(), ''MinHeap has a method called insert.'');' + testString: 'assert((function() { var test = false; if (typeof MinHeap !== "undefined") { test = new MinHeap() } else { return false; }; return (typeof test.insert == "function")})(), "MinHeap has a method called insert.");' - text: MinHeap has a method called remove. - testString: 'assert((function() { var test = false; if (typeof MinHeap !== ''undefined'') { test = new MinHeap() } else { return false; }; return (typeof test.remove == ''function'')})(), ''MinHeap has a method called remove.'');' + testString: 'assert((function() { var test = false; if (typeof MinHeap !== "undefined") { test = new MinHeap() } else { return false; }; return (typeof test.remove == "function")})(), "MinHeap has a method called remove.");' - text: MinHeap has a method called sort. - testString: 'assert((function() { var test = false; if (typeof MinHeap !== ''undefined'') { test = new MinHeap() } else { return false; }; return (typeof test.sort == ''function'')})(), ''MinHeap has a method called sort.'');' + testString: 'assert((function() { var test = false; if (typeof MinHeap !== "undefined") { test = new MinHeap() } else { return false; }; return (typeof test.sort == "function")})(), "MinHeap has a method called sort.");' - text: The sort method returns an array containing all items added to the min heap in sorted order. - testString: 'assert((function() { var test = false; if (typeof MinHeap !== ''undefined'') { test = new MinHeap() } else { return false; }; test.insert(3); test.insert(12); test.insert(5); test.insert(10); test.insert(1); test.insert(27); test.insert(42); test.insert(57); test.insert(5); var result = test.sort(); return (isSorted(result)); })(), ''The sort method returns an array containing all items added to the min heap in sorted order.'');' + testString: 'assert((function() { var test = false; if (typeof MinHeap !== "undefined") { test = new MinHeap() } else { return false; }; test.insert(3); test.insert(12); test.insert(5); test.insert(10); test.insert(1); test.insert(27); test.insert(42); test.insert(57); test.insert(5); var result = test.sort(); return (isSorted(result)); })(), "The sort method returns an array containing all items added to the min heap in sorted order.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/data-structures/incidence-matrix.english.md b/curriculum/challenges/english/08-coding-interview-prep/data-structures/incidence-matrix.english.md index 3f6b5404c2..4b3fb10c64 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/data-structures/incidence-matrix.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/data-structures/incidence-matrix.english.md @@ -32,15 +32,15 @@ These five nodes have relationships following relationships. The first edge is b ```yml tests: - text: incMatUndirected should only contain five nodes. - testString: 'assert((incMatUndirected.length === 5) && incMatUndirected.map(function(x) { return x.length === 4 }).reduce(function(a, b) { return a && b }) , ''incMatUndirected should only contain five nodes.'');' + testString: 'assert((incMatUndirected.length === 5) && incMatUndirected.map(function(x) { return x.length === 4 }).reduce(function(a, b) { return a && b }) , "incMatUndirected should only contain five nodes.");' - text: There should be a first edge between the first and second node. - testString: 'assert((incMatUndirected[0][0] === 1) && (incMatUndirected[1][0] === 1), ''There should be a first edge between the first and second node.'');' + testString: 'assert((incMatUndirected[0][0] === 1) && (incMatUndirected[1][0] === 1), "There should be a first edge between the first and second node.");' - text: There should be a second edge between the second and third node. - testString: 'assert((incMatUndirected[1][1] === 1) && (incMatUndirected[2][1] === 1), ''There should be a second edge between the second and third node.'');' + testString: 'assert((incMatUndirected[1][1] === 1) && (incMatUndirected[2][1] === 1), "There should be a second edge between the second and third node.");' - text: There should be a third edge between the third and fifth node. - testString: 'assert((incMatUndirected[2][2] === 1) && (incMatUndirected[4][2] === 1), ''There should be a third edge between the third and fifth node.'');' + testString: 'assert((incMatUndirected[2][2] === 1) && (incMatUndirected[4][2] === 1), "There should be a third edge between the third and fifth node.");' - text: There should be a fourth edge between the second and fourth node. - testString: 'assert((incMatUndirected[1][3] === 1) && (incMatUndirected[3][3] === 1), ''There should be a fourth edge between the second and fourth node.'');' + testString: 'assert((incMatUndirected[1][3] === 1) && (incMatUndirected[3][3] === 1), "There should be a fourth edge between the second and fourth node.");' ``` @@ -53,7 +53,7 @@ tests: ```js var incMatUndirected = [ - + ]; ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/data-structures/insert-an-element-into-a-max-heap.english.md b/curriculum/challenges/english/08-coding-interview-prep/data-structures/insert-an-element-into-a-max-heap.english.md index ddc218f077..5a8813b96d 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/data-structures/insert-an-element-into-a-max-heap.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/data-structures/insert-an-element-into-a-max-heap.english.md @@ -35,13 +35,13 @@ Finally, add a print method which returns an array of all the items that have be ```yml tests: - text: The MaxHeap data structure exists. - testString: 'assert((function() { var test = false; if (typeof MaxHeap !== ''undefined'') { test = new MaxHeap() }; return (typeof test == ''object'')})(), ''The MaxHeap data structure exists.'');' + testString: 'assert((function() { var test = false; if (typeof MaxHeap !== "undefined") { test = new MaxHeap() }; return (typeof test == "object")})(), "The MaxHeap data structure exists.");' - text: MaxHeap has a method called insert. - testString: 'assert((function() { var test = false; if (typeof MaxHeap !== ''undefined'') { test = new MaxHeap() } else { return false; }; return (typeof test.insert == ''function'')})(), ''MaxHeap has a method called insert.'');' + testString: 'assert((function() { var test = false; if (typeof MaxHeap !== "undefined") { test = new MaxHeap() } else { return false; }; return (typeof test.insert == "function")})(), "MaxHeap has a method called insert.");' - text: MaxHeap has a method called print. - testString: 'assert((function() { var test = false; if (typeof MaxHeap !== ''undefined'') { test = new MaxHeap() } else { return false; }; return (typeof test.print == ''function'')})(), ''MaxHeap has a method called print.'');' + testString: 'assert((function() { var test = false; if (typeof MaxHeap !== "undefined") { test = new MaxHeap() } else { return false; }; return (typeof test.print == "function")})(), "MaxHeap has a method called print.");' - text: The insert method adds elements according to the max heap property. - testString: 'assert((function() { var test = false; if (typeof MaxHeap !== ''undefined'') { test = new MaxHeap() } else { return false; }; test.insert(50); test.insert(100); test.insert(700); test.insert(32); test.insert(51); let result = test.print(); return ((result.length == 5) ? result[0] == 700 : result[1] == 700) })(), ''The insert method adds elements according to the max heap property.'');' + testString: 'assert((function() { var test = false; if (typeof MaxHeap !== "undefined") { test = new MaxHeap() } else { return false; }; test.insert(50); test.insert(100); test.insert(700); test.insert(32); test.insert(51); let result = test.print(); return ((result.length == 5) ? result[0] == 700 : result[1] == 700) })(), "The insert method adds elements according to the max heap property.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/data-structures/invert-a-binary-tree.english.md b/curriculum/challenges/english/08-coding-interview-prep/data-structures/invert-a-binary-tree.english.md index 09f2ace129..ebc2f1284d 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/data-structures/invert-a-binary-tree.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/data-structures/invert-a-binary-tree.english.md @@ -20,13 +20,13 @@ Here will we create a function to invert a binary tree. Given a binary tree, we ```yml tests: - text: The BinarySearchTree data structure exists. - testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== ''undefined'') { test = new BinarySearchTree() }; return (typeof test == ''object'')})(), ''The BinarySearchTree data structure exists.'');' + testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== "undefined") { test = new BinarySearchTree() }; return (typeof test == "object")})(), "The BinarySearchTree data structure exists.");' - text: The binary search tree has a method called invert. - testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== ''undefined'') { test = new BinarySearchTree() } else { return false; }; return (typeof test.invert == ''function'')})(), ''The binary search tree has a method called invert.'');' + testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== "undefined") { test = new BinarySearchTree() } else { return false; }; return (typeof test.invert == "function")})(), "The binary search tree has a method called invert.");' - text: The invert method correctly inverts the tree structure. - testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== ''undefined'') { test = new BinarySearchTree() } else { return false; }; if (typeof test.invert !== ''function'') { return false; }; test.add(4); test.add(1); test.add(7); test.add(87); test.add(34); test.add(45); test.add(73); test.add(8); test.invert(); return test.inorder().join('''') == ''877345348741''; })(), ''The invert method correctly inverts the tree structure.'');' + testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== "undefined") { test = new BinarySearchTree() } else { return false; }; if (typeof test.invert !== "function") { return false; }; test.add(4); test.add(1); test.add(7); test.add(87); test.add(34); test.add(45); test.add(73); test.add(8); test.invert(); return test.inorder().join("") == "877345348741"; })(), "The invert method correctly inverts the tree structure.");' - text: Inverting an empty tree returns null. - testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== ''undefined'') { test = new BinarySearchTree() } else { return false; }; if (typeof test.invert !== ''function'') { return false; }; return (test.invert() == null); })(), ''Inverting an empty tree returns null.'');' + testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== "undefined") { test = new BinarySearchTree() } else { return false; }; if (typeof test.invert !== "function") { return false; }; return (test.invert() == null); })(), "Inverting an empty tree returns null.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/data-structures/learn-how-a-stack-works.english.md b/curriculum/challenges/english/08-coding-interview-prep/data-structures/learn-how-a-stack-works.english.md index 5bcaa3859b..092dfd78d0 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/data-structures/learn-how-a-stack-works.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/data-structures/learn-how-a-stack-works.english.md @@ -25,13 +25,13 @@ Modify the given array and treat it like a stack using the JavaScri ```yml tests: - text: homeworkStack should only contain 4 elements. - testString: 'assert(homeworkStack.length === 4, ''homeworkStack should only contain 4 elements.'');' + testString: 'assert(homeworkStack.length === 4, "homeworkStack should only contain 4 elements.");' - text: The last element in homeworkStack should be "CS50". - testString: 'assert(homeworkStack[3] === ''CS50'', ''The last element in homeworkStack should be "CS50".'');' + testString: 'assert(homeworkStack[3] === "CS50", "The last element in homeworkStack should be "CS50".");' - text: homeworkStack should not contain "PSY44". - testString: 'assert(homeworkStack.indexOf(''PSY44'') === -1, ''homeworkStack should not contain "PSY44".'');' + testString: 'assert(homeworkStack.indexOf("PSY44") === -1, "homeworkStack should not contain "PSY44".");' - text: The initial declaration of the homeworkStack should not be changed. - testString: 'assert(code.match(/=/g).length === 1 && /homeworkStack\s*=\s*\["BIO12"\s*,\s*"HIS80"\s*,\s*"MAT122"\s*,\s*"PSY44"\]/.test(code), ''The initial declaration of the homeworkStack should not be changed.'');' + testString: 'assert(code.match(/=/g).length === 1 && /homeworkStack\s*=\s*\["BIO12"\s*,\s*"HIS80"\s*,\s*"MAT122"\s*,\s*"PSY44"\]/.test(code), "The initial declaration of the homeworkStack should not be changed.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/data-structures/perform-a-difference-on-two-sets-of-data.english.md b/curriculum/challenges/english/08-coding-interview-prep/data-structures/perform-a-difference-on-two-sets-of-data.english.md index a8b0b8ddf2..ab2ab46b51 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/data-structures/perform-a-difference-on-two-sets-of-data.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/data-structures/perform-a-difference-on-two-sets-of-data.english.md @@ -21,9 +21,9 @@ For example, if setA = ['a','b','c'] and setB = ['a','b','d', ```yml tests: - text: Your Set class should have a difference method. - testString: 'assert(function(){var test = new Set(); return (typeof test.difference === ''function'')}, ''Your Set class should have a difference method.'');' + testString: 'assert(function(){var test = new Set(); return (typeof test.difference === "function")}, "Your Set class should have a difference method.");' - text: The proper collection was returned - testString: 'assert(function(){var setA = new Set(); var setB = new Set(); setA.add(''a''); setA.add(''b''); setA.add(''c''); setB.add(''c''); setB.add(''d''); var differenceSetAB = setA.difference(setB); return (differenceSetAB.size() === 2) && (differenceSetAB.values() === [ ''a'', ''b'' ])}, ''The proper collection was returned'');' + testString: 'assert(function(){var setA = new Set(); var setB = new Set(); setA.add("a"); setA.add("b"); setA.add("c"); setB.add("c"); setB.add("d"); var differenceSetAB = setA.difference(setB); return (differenceSetAB.size() === 2) && (differenceSetAB.values() === [ "a", "b" ])}, "The proper collection was returned");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/data-structures/perform-a-subset-check-on-two-sets-of-data.english.md b/curriculum/challenges/english/08-coding-interview-prep/data-structures/perform-a-subset-check-on-two-sets-of-data.english.md index 2d836faeb6..bb67b764c6 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/data-structures/perform-a-subset-check-on-two-sets-of-data.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/data-structures/perform-a-subset-check-on-two-sets-of-data.english.md @@ -21,17 +21,17 @@ For example, if setA = ['a','b'] and setB = ['a','b','c','d'] ```yml tests: - text: Your Set class should have a union method. - testString: 'assert(function(){var test = new Set(); return (typeof test.subset === ''function'')}, ''Your Set class should have a union method.'');' + testString: 'assert(function(){var test = new Set(); return (typeof test.subset === "function")}, "Your Set class should have a union method.");' - text: The first Set() was contained in the second Set - testString: 'assert(function(){var setA = new Set(); var setB = new Set(); setA.add(''a''); setB.add(''b''); setB.add(''c''); setB.add(''a''); setB.add(''d''); var subsetSetAB = setA.subset(setB);return (subsetSetAB === true)}, ''The first Set() was contained in the second Set'');' - - text: '[''a'', ''b''].subset([''a'', ''b'', ''c'', ''d'']) should return true")' - testString: 'assert(function(){var setA = new Set(); var setB = new Set(); setA.add(''a''); setA.add(''b''); setB.add(''a''); setB.add(''b''); setB.add(''c''); setB.add(''d''); var subsetSetAB = setA.subset(setB); return (subsetSetAB === true)}, "[''a'', ''b''].subset([''a'', ''b'', ''c'', ''d'']) should return true");' - - text: '[''a'', ''b'', ''c''].subset([''a'', ''b'']) should return false")' - testString: 'assert(function(){var setA = new Set(); var setB = new Set(); setA.add(''a''); setA.add(''b''); setA.add(''c''); setB.add(''a''); setB.add(''b''); var subsetSetAB = setA.subset(setB); return (subsetSetAB === false)}, "[''a'', ''b'', ''c''].subset([''a'', ''b'']) should return false");' + testString: 'assert(function(){var setA = new Set(); var setB = new Set(); setA.add("a"); setB.add("b"); setB.add("c"); setB.add("a"); setB.add("d"); var subsetSetAB = setA.subset(setB);return (subsetSetAB === true)}, "The first Set() was contained in the second Set");' + - text: '["a", "b"].subset(["a", "b", "c", "d"]) should return true")' + testString: 'assert(function(){var setA = new Set(); var setB = new Set(); setA.add("a"); setA.add("b"); setB.add("a"); setB.add("b"); setB.add("c"); setB.add("d"); var subsetSetAB = setA.subset(setB); return (subsetSetAB === true)}, "["a", "b"].subset(["a", "b", "c", "d"]) should return true");' + - text: '["a", "b", "c"].subset(["a", "b"]) should return false")' + testString: 'assert(function(){var setA = new Set(); var setB = new Set(); setA.add("a"); setA.add("b"); setA.add("c"); setB.add("a"); setB.add("b"); var subsetSetAB = setA.subset(setB); return (subsetSetAB === false)}, "["a", "b", "c"].subset(["a", "b"]) should return false");' - text: '[].subset([]) should return true' - testString: 'assert(function(){var setA = new Set(); var setB = new Set(); var subsetSetAB = setA.subset(setB); return (subsetSetAB === true)}, ''[].subset([]) should return true'');' - - text: '[''a'', ''b''].subset([''c'', ''d'']) should return false")' - testString: 'assert(function(){var setA = new Set(); var setB = new Set(); setA.add(''a''); setA.add(''b''); setB.add(''c''); setB.add(''d''); var subsetSetAB = setA.subset(setB); return (subsetSetAB === false)}, "[''a'', ''b''].subset([''c'', ''d'']) should return false");' + testString: 'assert(function(){var setA = new Set(); var setB = new Set(); var subsetSetAB = setA.subset(setB); return (subsetSetAB === true)}, "[].subset([]) should return true");' + - text: '["a", "b"].subset(["c", "d"]) should return false")' + testString: 'assert(function(){var setA = new Set(); var setB = new Set(); setA.add("a"); setA.add("b"); setB.add("c"); setB.add("d"); var subsetSetAB = setA.subset(setB); return (subsetSetAB === false)}, "["a", "b"].subset(["c", "d"]) should return false");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/data-structures/perform-a-union-on-two-sets.english.md b/curriculum/challenges/english/08-coding-interview-prep/data-structures/perform-a-union-on-two-sets.english.md index 2ecfcf4a55..232b96349f 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/data-structures/perform-a-union-on-two-sets.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/data-structures/perform-a-union-on-two-sets.english.md @@ -21,9 +21,9 @@ For example, if setA = ['a','b','c'] and setB = ['a','b','d', ```yml tests: - text: Your Set class should have a union method. - testString: 'assert((function(){var test = new Set(); return (typeof test.union === ''function'')})(), ''Your Set class should have a union method.'');' + testString: 'assert((function(){var test = new Set(); return (typeof test.union === "function")})(), "Your Set class should have a union method.");' - text: The proper collection was returned - testString: 'assert((function(){var setA = new Set(); var setB = new Set(); setA.add(''a''); setA.add(''b''); setA.add(''c''); setB.add(''c''); setB.add(''d''); var unionSetAB = setA.union(setB); var final = unionSetAB.values(); return (final.indexOf(''a'') !== -1 && final.indexOf(''b'') !== -1 && final.indexOf(''c'') !== -1 && final.indexOf(''d'') !== -1 && final.length === 4)})(), ''The proper collection was returned'');' + testString: 'assert((function(){var setA = new Set(); var setB = new Set(); setA.add("a"); setA.add("b"); setA.add("c"); setB.add("c"); setB.add("d"); var unionSetAB = setA.union(setB); var final = unionSetAB.values(); return (final.indexOf("a") !== -1 && final.indexOf("b") !== -1 && final.indexOf("c") !== -1 && final.indexOf("d") !== -1 && final.length === 4)})(), "The proper collection was returned");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/data-structures/perform-an-intersection-on-two-sets-of-data.english.md b/curriculum/challenges/english/08-coding-interview-prep/data-structures/perform-an-intersection-on-two-sets-of-data.english.md index e95b5475a8..c2933543c2 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/data-structures/perform-an-intersection-on-two-sets-of-data.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/data-structures/perform-an-intersection-on-two-sets-of-data.english.md @@ -21,9 +21,9 @@ For example, if setA = ['a','b','c'] and setB = ['a','b','d', ```yml tests: - text: Your Set class should have a intersection method. - testString: 'assert(function(){var test = new Set(); return (typeof test.intersection === ''function'')}, ''Your Set class should have a intersection method.'');' + testString: 'assert(function(){var test = new Set(); return (typeof test.intersection === "function")}, "Your Set class should have a intersection method.");' - text: The proper collection was returned - testString: 'assert(function(){ var setA = new Set(); var setB = new Set(); setA.add(''a''); setA.add(''b''); setA.add(''c''); setB.add(''c''); setB.add(''d''); var intersectionSetAB = setA.intersection(setB); return (intersectionSetAB.size() === 1 && intersectionSetAB.values()[0] === ''c'')}, ''The proper collection was returned'');' + testString: 'assert(function(){ var setA = new Set(); var setB = new Set(); setA.add("a"); setA.add("b"); setA.add("c"); setB.add("c"); setB.add("d"); var intersectionSetAB = setA.intersection(setB); return (intersectionSetAB.size() === 1 && intersectionSetAB.values()[0] === "c")}, "The proper collection was returned");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/data-structures/remove-an-element-from-a-max-heap.english.md b/curriculum/challenges/english/08-coding-interview-prep/data-structures/remove-an-element-from-a-max-heap.english.md index eaa702d42d..1ad3263cfc 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/data-structures/remove-an-element-from-a-max-heap.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/data-structures/remove-an-element-from-a-max-heap.english.md @@ -24,15 +24,15 @@ Instructions: Add a method to our max heap called remove. This method should ret ```yml tests: - text: The MaxHeap data structure exists. - testString: 'assert((function() { var test = false; if (typeof MaxHeap !== ''undefined'') { test = new MaxHeap() }; return (typeof test == ''object'')})(), ''The MaxHeap data structure exists.'');' + testString: 'assert((function() { var test = false; if (typeof MaxHeap !== "undefined") { test = new MaxHeap() }; return (typeof test == "object")})(), "The MaxHeap data structure exists.");' - text: MaxHeap has a method called print. - testString: 'assert((function() { var test = false; if (typeof MaxHeap !== ''undefined'') { test = new MaxHeap() } else { return false; }; return (typeof test.print == ''function'')})(), ''MaxHeap has a method called print.'');' + testString: 'assert((function() { var test = false; if (typeof MaxHeap !== "undefined") { test = new MaxHeap() } else { return false; }; return (typeof test.print == "function")})(), "MaxHeap has a method called print.");' - text: MaxHeap has a method called insert. - testString: 'assert((function() { var test = false; if (typeof MaxHeap !== ''undefined'') { test = new MaxHeap() } else { return false; }; return (typeof test.insert == ''function'')})(), ''MaxHeap has a method called insert.'');' + testString: 'assert((function() { var test = false; if (typeof MaxHeap !== "undefined") { test = new MaxHeap() } else { return false; }; return (typeof test.insert == "function")})(), "MaxHeap has a method called insert.");' - text: MaxHeap has a method called remove. - testString: 'assert((function() { var test = false; if (typeof MaxHeap !== ''undefined'') { test = new MaxHeap() } else { return false; }; return (typeof test.remove == ''function'')})(), ''MaxHeap has a method called remove.'');' + testString: 'assert((function() { var test = false; if (typeof MaxHeap !== "undefined") { test = new MaxHeap() } else { return false; }; return (typeof test.remove == "function")})(), "MaxHeap has a method called remove.");' - text: The remove method removes the greatest element from the max heap while maintaining the max heap property. - testString: 'assert((function() { var test = false; if (typeof MaxHeap !== ''undefined'') { test = new MaxHeap() } else { return false; }; test.insert(30); test.insert(300); test.insert(500); test.insert(10); let result = []; result.push(test.remove()); result.push(test.remove()); result.push(test.remove()); result.push(test.remove()); return (result.join('''') == ''5003003010'') })(), ''The remove method removes the greatest element from the max heap while maintaining the max heap property.'');' + testString: 'assert((function() { var test = false; if (typeof MaxHeap !== "undefined") { test = new MaxHeap() } else { return false; }; test.insert(30); test.insert(300); test.insert(500); test.insert(10); let result = []; result.push(test.remove()); result.push(test.remove()); result.push(test.remove()); result.push(test.remove()); return (result.join("") == "5003003010") })(), "The remove method removes the greatest element from the max heap while maintaining the max heap property.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/data-structures/remove-elements-from-a-linked-list-by-index.english.md b/curriculum/challenges/english/08-coding-interview-prep/data-structures/remove-elements-from-a-linked-list-by-index.english.md index 4239643dab..646b441063 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/data-structures/remove-elements-from-a-linked-list-by-index.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/data-structures/remove-elements-from-a-linked-list-by-index.english.md @@ -25,15 +25,15 @@ Remember to keep count of the currentIndex. ```yml tests: - text: Your LinkedList class should have a removeAt method. - testString: 'assert((function(){var test = new LinkedList(); return (typeof test.removeAt === ''function'')}()), ''Your LinkedList class should have a removeAt method.'');' + testString: 'assert((function(){var test = new LinkedList(); return (typeof test.removeAt === "function")}()), "Your LinkedList class should have a removeAt method.");' - text: Your removeAt method should reduce the length of the linked list - testString: 'assert((function(){var test = new LinkedList(); test.add(''cat''); test.add(''dog''); test.add(''kitten''); test.removeAt(1); return test.size() === 2}()), ''Your removeAt method should reduce the length of the linked list'');' + testString: 'assert((function(){var test = new LinkedList(); test.add("cat"); test.add("dog"); test.add("kitten"); test.removeAt(1); return test.size() === 2}()), "Your removeAt method should reduce the length of the linked list");' - text: Your removeAt method should also return the element of the removed node. - testString: 'assert((function(){var test = new LinkedList(); test.add(''cat''); test.add(''dog''); test.add(''kitten''); return test.removeAt(1) === ''dog''}()), ''Your removeAt method should also return the element of the removed node.'');' + testString: 'assert((function(){var test = new LinkedList(); test.add("cat"); test.add("dog"); test.add("kitten"); return test.removeAt(1) === "dog"}()), "Your removeAt method should also return the element of the removed node.");' - text: Your removeAt method should also return null if the given index is less than 0 - testString: 'assert((function(){var test = new LinkedList(); test.add(''cat''); test.add(''dog''); test.add(''kitten''); return (test.removeAt(-1) === null)}()), ''Your removeAt method should also return null if the given index is less than 0'');' + testString: 'assert((function(){var test = new LinkedList(); test.add("cat"); test.add("dog"); test.add("kitten"); return (test.removeAt(-1) === null)}()), "Your removeAt method should also return null if the given index is less than 0");' - text: Your removeAt method should also return null if the given index is equal or more than the length of the linked list. - testString: 'assert((function(){var test = new LinkedList(); test.add(''cat''); test.add(''dog''); test.add(''kitten''); return (test.removeAt(3) === null)}()), ''Your removeAt method should also return null if the given index is equal or more than the length of the linked list.'');' + testString: 'assert((function(){var test = new LinkedList(); test.add("cat"); test.add("dog"); test.add("kitten"); return (test.removeAt(3) === null)}()), "Your removeAt method should also return null if the given index is equal or more than the length of the linked list.");' ``` @@ -45,14 +45,14 @@ tests:
```js -function LinkedList() { - var length = 0; - var head = null; +function LinkedList() { + var length = 0; + var head = null; - var Node = function(element){ // {1} - this.element = element; - this.next = null; - }; + var Node = function(element){ // {1} + this.element = element; + this.next = null; + }; this.size = function(){ return length; @@ -77,7 +77,7 @@ function LinkedList() { } length++; - }; + }; this.remove = function(element){ var currentNode = head; diff --git a/curriculum/challenges/english/08-coding-interview-prep/data-structures/remove-elements-from-a-linked-list.english.md b/curriculum/challenges/english/08-coding-interview-prep/data-structures/remove-elements-from-a-linked-list.english.md index 257e0b101b..68afd57186 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/data-structures/remove-elements-from-a-linked-list.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/data-structures/remove-elements-from-a-linked-list.english.md @@ -25,13 +25,13 @@ The length of the list should decrease by one every time an element ```yml tests: - text: Your LinkedList class should have a remove method. - testString: 'assert((function(){var test = new LinkedList(); return (typeof test.remove === ''function'')}()), ''Your LinkedList class should have a remove method.'');' + testString: 'assert((function(){var test = new LinkedList(); return (typeof test.remove === "function")}()), "Your LinkedList class should have a remove method.");' - text: Your remove method should reassign head to the second node when the first node is removed. - testString: 'assert((function(){var test = new LinkedList(); test.add(''cat''); test.add(''dog''); test.remove(''cat''); return test.head().element === ''dog''}()), ''Your remove method should reassign head to the second node when the first node is removed.'');' + testString: 'assert((function(){var test = new LinkedList(); test.add("cat"); test.add("dog"); test.remove("cat"); return test.head().element === "dog"}()), "Your remove method should reassign head to the second node when the first node is removed.");' - text: Your remove method should decrease the length of the linked list by one for every node removed. - testString: 'assert((function(){var test = new LinkedList(); test.add(''cat''); test.add(''dog''); test.remove(''cat''); return test.size() === 1})(), ''Your remove method should decrease the length of the linked list by one for every node removed.'');' + testString: 'assert((function(){var test = new LinkedList(); test.add("cat"); test.add("dog"); test.remove("cat"); return test.size() === 1})(), "Your remove method should decrease the length of the linked list by one for every node removed.");' - text: Your remove method should reassign the reference of the previous node of the removed node to the removed node's next reference. - testString: 'assert((function(){var test = new LinkedList(); test.add(''cat''); test.add(''dog'');test.add(''kitten''); test.remove(''dog''); return test.head().next.element === ''kitten''})(), ''Your remove method should reassign the reference of the previous node of the removed node to the removed node's next reference.'');' + testString: 'assert((function(){var test = new LinkedList(); test.add("cat"); test.add("dog");test.add("kitten"); test.remove("dog"); return test.head().next.element === "kitten"})(), "Your remove method should reassign the reference of the previous node of the removed node to the removed node's next reference.");' ``` @@ -43,14 +43,14 @@ tests:
```js -function LinkedList() { - var length = 0; - var head = null; +function LinkedList() { + var length = 0; + var head = null; - var Node = function(element){ - this.element = element; - this.next = null; - }; + var Node = function(element){ + this.element = element; + this.next = null; + }; this.size = function(){ return length; @@ -75,7 +75,7 @@ function LinkedList() { } length++; - }; + }; this.remove = function(element){ // Only change code below this line @@ -129,29 +129,29 @@ class LinkedList { current = current.next; } - current.next = node; + current.next = node; } - + ++this._length; } - + remove (element) { if (this._head === null) return; - + let previous; let current = this._head; - + while (current.next !== null && current.element !== element) { previous = current; current = current.next; } - + if (previous) { previous.next = current.next; } else { this._head = current.next; } - + --this._length; } } diff --git a/curriculum/challenges/english/08-coding-interview-prep/data-structures/remove-from-a-set.english.md b/curriculum/challenges/english/08-coding-interview-prep/data-structures/remove-from-a-set.english.md index 20bf2c34d3..76fc65ddde 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/data-structures/remove-from-a-set.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/data-structures/remove-from-a-set.english.md @@ -20,11 +20,11 @@ In this exercises we are going to create a delete function for our set. The func ```yml tests: - text: Your Set class should have a remove method. - testString: 'assert((function(){var test = new Set(); return (typeof test.remove === ''function'')}()), ''Your Set class should have a remove method.'');' + testString: 'assert((function(){var test = new Set(); return (typeof test.remove === "function")}()), "Your Set class should have a remove method.");' - text: Your remove method should only remove items that are present in the set. - testString: 'assert.deepEqual((function(){var test = new Set(); test.add(''a'');test.add(''b'');test.remove(''c''); return test.values(); })(), [''a'', ''b''], ''Your remove method should only remove items that are present in the set.'');' + testString: 'assert.deepEqual((function(){var test = new Set(); test.add("a");test.add("b");test.remove("c"); return test.values(); })(), ["a", "b"], "Your remove method should only remove items that are present in the set.");' - text: Your remove method should remove the given item from the set. - testString: 'assert((function(){var test = new Set(); test.add(''a'');test.add(''b'');test.remove(''a''); var vals = test.values(); return (vals[0] === ''b'' && vals.length === 1)}()), ''Your remove method should remove the given item from the set.'');' + testString: 'assert((function(){var test = new Set(); test.add("a");test.add("b");test.remove("a"); var vals = test.values(); return (vals[0] === "b" && vals.length === 1)}()), "Your remove method should remove the given item from the set.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/data-structures/remove-items-from-a-set-in-es6.english.md b/curriculum/challenges/english/08-coding-interview-prep/data-structures/remove-items-from-a-set-in-es6.english.md index 1618d65073..7cf03ac15d 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/data-structures/remove-items-from-a-set-in-es6.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/data-structures/remove-items-from-a-set-in-es6.english.md @@ -15,7 +15,7 @@ Now remove an item from your Set with the delete method. ## Instructions
-Now, create a set with the integers 1, 2, 3, 4, & 5. +Now, create a set with the integers 1, 2, 3, 4, & 5. Remove the values 2 and 5, and then return the set.
@@ -25,7 +25,7 @@ Now, create a set with the integers 1, 2, 3, 4, & 5. ```yml tests: - text: 'Your Set should contain the values 1, 3, & 4' - testString: 'assert(function(){var test = checkSet(); return test.has(1) && test.has(3) && test.has(4) && test.size === 3}, ''Your Set should contain the values 1, 3, & 4'');' + testString: 'assert(function(){var test = checkSet(); return test.has(1) && test.has(3) && test.has(4) && test.size === 3}, "Your Set should contain the values 1, 3, & 4");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/data-structures/reverse-a-doubly-linked-list.english.md b/curriculum/challenges/english/08-coding-interview-prep/data-structures/reverse-a-doubly-linked-list.english.md index 4e2c5bd00c..7403961299 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/data-structures/reverse-a-doubly-linked-list.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/data-structures/reverse-a-doubly-linked-list.english.md @@ -20,17 +20,17 @@ Let's create one more method for our doubly linked list called reverse which rev ```yml tests: - text: The DoublyLinkedList data structure exists. - testString: 'assert((function() { var test = false; if (typeof DoublyLinkedList !== ''undefined'') { test = new DoublyLinkedList() }; return (typeof test == ''object'')})(), ''The DoublyLinkedList data structure exists.'');' + testString: 'assert((function() { var test = false; if (typeof DoublyLinkedList !== "undefined") { test = new DoublyLinkedList() }; return (typeof test == "object")})(), "The DoublyLinkedList data structure exists.");' - text: The DoublyLinkedList has a method called add. - testString: 'assert((function() { var test = false; if (typeof DoublyLinkedList !== ''undefined'') { test = new DoublyLinkedList() }; if (test.add == undefined) { return false; }; return (typeof test.add == ''function'')})(), ''The DoublyLinkedList has a method called add.'');' + testString: 'assert((function() { var test = false; if (typeof DoublyLinkedList !== "undefined") { test = new DoublyLinkedList() }; if (test.add == undefined) { return false; }; return (typeof test.add == "function")})(), "The DoublyLinkedList has a method called add.");' - text: The DoublyLinkedList has a method called reverse. - testString: 'assert((function() { var test = false; if (typeof DoublyLinkedList !== ''undefined'') { test = new DoublyLinkedList() }; if (test.reverse == undefined) { return false; }; return (typeof test.reverse == ''function'')})(), ''The DoublyLinkedList has a method called reverse.'');' + testString: 'assert((function() { var test = false; if (typeof DoublyLinkedList !== "undefined") { test = new DoublyLinkedList() }; if (test.reverse == undefined) { return false; }; return (typeof test.reverse == "function")})(), "The DoublyLinkedList has a method called reverse.");' - text: Reversing an empty list returns null. - testString: 'assert((function() { var test = false; if (typeof DoublyLinkedList !== ''undefined'') { test = new DoublyLinkedList() }; return (test.reverse() == null); })(), ''Reversing an empty list returns null.'');' + testString: 'assert((function() { var test = false; if (typeof DoublyLinkedList !== "undefined") { test = new DoublyLinkedList() }; return (test.reverse() == null); })(), "Reversing an empty list returns null.");' - text: The reverse method reverses the list. - testString: 'assert((function() { var test = false; if (typeof DoublyLinkedList !== ''undefined'') { test = new DoublyLinkedList() }; test.add(58); test.add(61); test.add(32); test.reverse(); return (test.print().join('''') == ''326158''); })(), ''The reverse method reverses the list.'');' + testString: 'assert((function() { var test = false; if (typeof DoublyLinkedList !== "undefined") { test = new DoublyLinkedList() }; test.add(58); test.add(61); test.add(32); test.reverse(); return (test.print().join("") == "326158"); })(), "The reverse method reverses the list.");' - text: The next and previous references are correctly maintained when a list is reversed. - testString: 'assert((function() { var test = false; if (typeof DoublyLinkedList !== ''undefined'') { test = new DoublyLinkedList() }; test.add(11); test.add(22); test.add(33); test.reverse(); return (test.printReverse().join('''') == ''112233''); })(), ''The next and previous references are correctly maintained when a list is reversed.'');' + testString: 'assert((function() { var test = false; if (typeof DoublyLinkedList !== "undefined") { test = new DoublyLinkedList() }; test.add(11); test.add(22); test.add(33); test.reverse(); return (test.printReverse().join("") == "112233"); })(), "The next and previous references are correctly maintained when a list is reversed.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/data-structures/search-within-a-linked-list.english.md b/curriculum/challenges/english/08-coding-interview-prep/data-structures/search-within-a-linked-list.english.md index 80e015fdd6..e231c45917 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/data-structures/search-within-a-linked-list.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/data-structures/search-within-a-linked-list.english.md @@ -22,15 +22,15 @@ Write an isEmpty method that checks if the linked list is empty, an ```yml tests: - text: Your LinkedList class should have a indexOf method. - testString: 'assert((function(){var test = new LinkedList(); return (typeof test.indexOf === ''function'')}()), ''Your LinkedList class should have a indexOf method.'');' + testString: 'assert((function(){var test = new LinkedList(); return (typeof test.indexOf === "function")}()), "Your LinkedList class should have a indexOf method.");' - text: Your LinkedList class should have a elementAt method. - testString: 'assert((function(){var test = new LinkedList(); return (typeof test.elementAt === ''function'')}()), ''Your LinkedList class should have a elementAt method.'');' + testString: 'assert((function(){var test = new LinkedList(); return (typeof test.elementAt === "function")}()), "Your LinkedList class should have a elementAt method.");' - text: Your size method should return the length of the linked list - testString: 'assert((function(){var test = new LinkedList(); test.add(''cat''); test.add(''dog''); test.add(''kitten''); return test.size() === 3}()), ''Your size method should return the length of the linked list'');' + testString: 'assert((function(){var test = new LinkedList(); test.add("cat"); test.add("dog"); test.add("kitten"); return test.size() === 3}()), "Your size method should return the length of the linked list");' - text: Your indexOf method should return the index of the given element. - testString: 'assert((function(){var test = new LinkedList(); test.add(''cat''); test.add(''dog''); test.add(''kitten''); return test.indexOf(''kitten'') === 2}()), ''Your indexOf method should return the index of the given element.'');' + testString: 'assert((function(){var test = new LinkedList(); test.add("cat"); test.add("dog"); test.add("kitten"); return test.indexOf("kitten") === 2}()), "Your indexOf method should return the index of the given element.");' - text: Your elementAt method should return at element at a given index. - testString: 'assert((function(){var test = new LinkedList(); test.add(''cat''); test.add(''dog''); test.add(''kitten''); return test.elementAt(1) === ''dog''}()), ''Your elementAt method should return at element at a given index.'');' + testString: 'assert((function(){var test = new LinkedList(); test.add("cat"); test.add("dog"); test.add("kitten"); return test.elementAt(1) === "dog"}()), "Your elementAt method should return at element at a given index.");' ``` @@ -42,14 +42,14 @@ tests:
```js -function LinkedList() { - var length = 0; - var head = null; +function LinkedList() { + var length = 0; + var head = null; - var Node = function(element){ // {1} - this.element = element; - this.next = null; - }; + var Node = function(element){ // {1} + this.element = element; + this.next = null; + }; this.size = function() { return length; @@ -74,7 +74,7 @@ function LinkedList() { } length++; - }; + }; this.remove = function(element){ var currentNode = head; diff --git a/curriculum/challenges/english/08-coding-interview-prep/data-structures/size-of-the-set.english.md b/curriculum/challenges/english/08-coding-interview-prep/data-structures/size-of-the-set.english.md index cd80c215e9..79ecfab72a 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/data-structures/size-of-the-set.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/data-structures/size-of-the-set.english.md @@ -20,9 +20,9 @@ In this exercise we are going to create a size function for our Set. This functi ```yml tests: - text: Your Set class should have a size method. - testString: 'assert((function(){var test = new Set(); return (typeof test.size === ''function'')}()), ''Your Set class should have a size method.'');' + testString: 'assert((function(){var test = new Set(); return (typeof test.size === "function")}()), "Your Set class should have a size method.");' - text: The size method should return the number of elements in the collection. - testString: 'assert((function(){var test = new Set(); test.add(''a'');test.add(''b'');test.remove(''a'');return (test.size() === 1)}()), ''The size method should return the number of elements in the collection.'');' + testString: 'assert((function(){var test = new Set(); test.add("a");test.add("b");test.remove("a");return (test.size() === 1)}()), "The size method should return the number of elements in the collection.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/data-structures/typed-arrays.english.md b/curriculum/challenges/english/08-coding-interview-prep/data-structures/typed-arrays.english.md index c5b97265de..7fc3eca4fc 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/data-structures/typed-arrays.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/data-structures/typed-arrays.english.md @@ -33,11 +33,11 @@ First create a buffer that is 64-bytes. Then create a Int32Ar ```yml tests: - text: Your buffer should be 64 bytes large. - testString: 'assert(buffer.byteLength === 64, ''Your buffer should be 64 bytes large.'');' + testString: 'assert(buffer.byteLength === 64, "Your buffer should be 64 bytes large.");' - text: Your i32View view of your buffer should be 64 bytes large. - testString: 'assert(i32View.byteLength === 64, ''Your i32View view of your buffer should be 64 bytes large.'');' + testString: 'assert(i32View.byteLength === 64, "Your i32View view of your buffer should be 64 bytes large.");' - text: Your i32View view of your buffer should be 16 elements long. - testString: 'assert(i32View.length === 16, ''Your i32View view of your buffer should be 16 elements long.'');' + testString: 'assert(i32View.length === 16, "Your i32View view of your buffer should be 16 elements long.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/data-structures/use-.has-and-.size-on-an-es6-set.english.md b/curriculum/challenges/english/08-coding-interview-prep/data-structures/use-.has-and-.size-on-an-es6-set.english.md index 1cdefce52b..e2949fac70 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/data-structures/use-.has-and-.size-on-an-es6-set.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/data-structures/use-.has-and-.size-on-an-es6-set.english.md @@ -26,7 +26,7 @@ In this exercise we will pass an array and a value to the checkSet() function. Y ```yml tests: - text: 'checkSet([4, 5, 6], 3) should return [ false, 3 ]' - testString: 'assert(function(){var test = checkSet([4,5,6], 3); test === [ false, 3 ]}, ''checkSet([4, 5, 6], 3) should return [ false, 3 ]'');' + testString: 'assert(function(){var test = checkSet([4,5,6], 3); test === [ false, 3 ]}, "checkSet([4, 5, 6], 3) should return [ false, 3 ]");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/data-structures/use-breadth-first-search-in-a-binary-search-tree.english.md b/curriculum/challenges/english/08-coding-interview-prep/data-structures/use-breadth-first-search-in-a-binary-search-tree.english.md index be05336cd0..70ee6ad89f 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/data-structures/use-breadth-first-search-in-a-binary-search-tree.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/data-structures/use-breadth-first-search-in-a-binary-search-tree.english.md @@ -22,19 +22,19 @@ Instructions: Let's create a breadth-first search method in our tree called BinarySearchTree data structure exists. - testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== ''undefined'') { test = new BinarySearchTree() }; return (typeof test == ''object'')})(), ''The BinarySearchTree data structure exists.'');' + testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== "undefined") { test = new BinarySearchTree() }; return (typeof test == "object")})(), "The BinarySearchTree data structure exists.");' - text: The binary search tree has a method called levelOrder. - testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== ''undefined'') { test = new BinarySearchTree() } else { return false; }; return (typeof test.levelOrder == ''function'')})(), ''The binary search tree has a method called levelOrder.'');' + testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== "undefined") { test = new BinarySearchTree() } else { return false; }; return (typeof test.levelOrder == "function")})(), "The binary search tree has a method called levelOrder.");' - text: The binary search tree has a method called reverseLevelOrder. - testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== ''undefined'') { test = new BinarySearchTree() } else { return false; }; return (typeof test.reverseLevelOrder == ''function'')})(), ''The binary search tree has a method called reverseLevelOrder.'');' + testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== "undefined") { test = new BinarySearchTree() } else { return false; }; return (typeof test.reverseLevelOrder == "function")})(), "The binary search tree has a method called reverseLevelOrder.");' - text: The levelOrder method returns an array of the tree node values explored in level order. - testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== ''undefined'') { test = new BinarySearchTree() } else { return false; }; if (typeof test.levelOrder !== ''function'') { return false; }; test.add(7); test.add(1); test.add(9); test.add(0); test.add(3); test.add(8); test.add(10); test.add(2); test.add(5); test.add(4); test.add(6); return (test.levelOrder().join('''') == ''719038102546''); })(), ''The levelOrder method returns an array of the tree node values explored in level order.'');' + testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== "undefined") { test = new BinarySearchTree() } else { return false; }; if (typeof test.levelOrder !== "function") { return false; }; test.add(7); test.add(1); test.add(9); test.add(0); test.add(3); test.add(8); test.add(10); test.add(2); test.add(5); test.add(4); test.add(6); return (test.levelOrder().join("") == "719038102546"); })(), "The levelOrder method returns an array of the tree node values explored in level order.");' - text: The reverseLevelOrder method returns an array of the tree node values explored in reverse level order. - testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== ''undefined'') { test = new BinarySearchTree() } else { return false; }; if (typeof test.reverseLevelOrder !== ''function'') { return false; }; test.add(7); test.add(1); test.add(9); test.add(0); test.add(3); test.add(8); test.add(10); test.add(2); test.add(5); test.add(4); test.add(6); return (test.reverseLevelOrder().join('''') == ''791108305264''); })(), ''The reverseLevelOrder method returns an array of the tree node values explored in reverse level order.'');' + testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== "undefined") { test = new BinarySearchTree() } else { return false; }; if (typeof test.reverseLevelOrder !== "function") { return false; }; test.add(7); test.add(1); test.add(9); test.add(0); test.add(3); test.add(8); test.add(10); test.add(2); test.add(5); test.add(4); test.add(6); return (test.reverseLevelOrder().join("") == "791108305264"); })(), "The reverseLevelOrder method returns an array of the tree node values explored in reverse level order.");' - text: The levelOrder method returns null for an empty tree. - testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== ''undefined'') { test = new BinarySearchTree() } else { return false; }; if (typeof test.levelOrder !== ''function'') { return false; }; return (test.levelOrder() == null); })(), ''The levelOrder method returns null for an empty tree.'');' + testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== "undefined") { test = new BinarySearchTree() } else { return false; }; if (typeof test.levelOrder !== "function") { return false; }; return (test.levelOrder() == null); })(), "The levelOrder method returns null for an empty tree.");' - text: The reverseLevelOrder method returns null for an empty tree. - testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== ''undefined'') { test = new BinarySearchTree() } else { return false; }; if (typeof test.reverseLevelOrder !== ''function'') { return false; }; return (test.reverseLevelOrder() == null); })(), ''The reverseLevelOrder method returns null for an empty tree.'');' + testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== "undefined") { test = new BinarySearchTree() } else { return false; }; if (typeof test.reverseLevelOrder !== "function") { return false; }; return (test.reverseLevelOrder() == null); })(), "The reverseLevelOrder method returns null for an empty tree.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/data-structures/use-depth-first-search-in-a-binary-search-tree.english.md b/curriculum/challenges/english/08-coding-interview-prep/data-structures/use-depth-first-search-in-a-binary-search-tree.english.md index fb602cc681..d70480b03a 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/data-structures/use-depth-first-search-in-a-binary-search-tree.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/data-structures/use-depth-first-search-in-a-binary-search-tree.english.md @@ -26,25 +26,25 @@ Define inorder, preorder, and postorder m ```yml tests: - text: The BinarySearchTree data structure exists. - testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== ''undefined'') { test = new BinarySearchTree() }; return (typeof test == ''object'')})(), ''The BinarySearchTree data structure exists.'');' + testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== "undefined") { test = new BinarySearchTree() }; return (typeof test == "object")})(), "The BinarySearchTree data structure exists.");' - text: The binary search tree has a method called inorder. - testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== ''undefined'') { test = new BinarySearchTree() } else { return false; }; return (typeof test.inorder == ''function'')})(), ''The binary search tree has a method called inorder.'');' + testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== "undefined") { test = new BinarySearchTree() } else { return false; }; return (typeof test.inorder == "function")})(), "The binary search tree has a method called inorder.");' - text: The binary search tree has a method called preorder. - testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== ''undefined'') { test = new BinarySearchTree() } else { return false; }; return (typeof test.preorder == ''function'')})(), ''The binary search tree has a method called preorder.'');' + testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== "undefined") { test = new BinarySearchTree() } else { return false; }; return (typeof test.preorder == "function")})(), "The binary search tree has a method called preorder.");' - text: The binary search tree has a method called postorder. - testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== ''undefined'') { test = new BinarySearchTree() } else { return false; }; return (typeof test.postorder == ''function'')})(), ''The binary search tree has a method called postorder.'');' + testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== "undefined") { test = new BinarySearchTree() } else { return false; }; return (typeof test.postorder == "function")})(), "The binary search tree has a method called postorder.");' - text: The inorder method returns an array of the node values that result from an inorder traversal. - testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== ''undefined'') { test = new BinarySearchTree() } else { return false; }; if (typeof test.inorder !== ''function'') { return false; }; test.add(7); test.add(1); test.add(9); test.add(0); test.add(3); test.add(8); test.add(10); test.add(2); test.add(5); test.add(4); test.add(6); return (test.inorder().join('''') == ''012345678910''); })(), ''The inorder method returns an array of the node values that result from an inorder traversal.'');' + testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== "undefined") { test = new BinarySearchTree() } else { return false; }; if (typeof test.inorder !== "function") { return false; }; test.add(7); test.add(1); test.add(9); test.add(0); test.add(3); test.add(8); test.add(10); test.add(2); test.add(5); test.add(4); test.add(6); return (test.inorder().join("") == "012345678910"); })(), "The inorder method returns an array of the node values that result from an inorder traversal.");' - text: The preorder method returns an array of the node values that result from a preorder traversal. - testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== ''undefined'') { test = new BinarySearchTree() } else { return false; }; if (typeof test.preorder !== ''function'') { return false; }; test.add(7); test.add(1); test.add(9); test.add(0); test.add(3); test.add(8); test.add(10); test.add(2); test.add(5); test.add(4); test.add(6); return (test.preorder().join('''') == ''710325469810''); })(), ''The preorder method returns an array of the node values that result from a preorder traversal.'');' + testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== "undefined") { test = new BinarySearchTree() } else { return false; }; if (typeof test.preorder !== "function") { return false; }; test.add(7); test.add(1); test.add(9); test.add(0); test.add(3); test.add(8); test.add(10); test.add(2); test.add(5); test.add(4); test.add(6); return (test.preorder().join("") == "710325469810"); })(), "The preorder method returns an array of the node values that result from a preorder traversal.");' - text: The postorder method returns an array of the node values that result from a postorder traversal. - testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== ''undefined'') { test = new BinarySearchTree() } else { return false; }; if (typeof test.postorder !== ''function'') { return false; }; test.add(7); test.add(1); test.add(9); test.add(0); test.add(3); test.add(8); test.add(10); test.add(2); test.add(5); test.add(4); test.add(6); return (test.postorder().join('''') == ''024653181097''); })(), ''The postorder method returns an array of the node values that result from a postorder traversal.'');' + testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== "undefined") { test = new BinarySearchTree() } else { return false; }; if (typeof test.postorder !== "function") { return false; }; test.add(7); test.add(1); test.add(9); test.add(0); test.add(3); test.add(8); test.add(10); test.add(2); test.add(5); test.add(4); test.add(6); return (test.postorder().join("") == "024653181097"); })(), "The postorder method returns an array of the node values that result from a postorder traversal.");' - text: The inorder method returns null for an empty tree. - testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== ''undefined'') { test = new BinarySearchTree() } else { return false; }; if (typeof test.inorder !== ''function'') { return false; }; return (test.inorder() == null); })(), ''The inorder method returns null for an empty tree.'');' + testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== "undefined") { test = new BinarySearchTree() } else { return false; }; if (typeof test.inorder !== "function") { return false; }; return (test.inorder() == null); })(), "The inorder method returns null for an empty tree.");' - text: The preorder method returns null for an empty tree. - testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== ''undefined'') { test = new BinarySearchTree() } else { return false; }; if (typeof test.preorder !== ''function'') { return false; }; return (test.preorder() == null); })(), ''The preorder method returns null for an empty tree.'');' + testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== "undefined") { test = new BinarySearchTree() } else { return false; }; if (typeof test.preorder !== "function") { return false; }; return (test.preorder() == null); })(), "The preorder method returns null for an empty tree.");' - text: The postorder method returns null for an empty tree. - testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== ''undefined'') { test = new BinarySearchTree() } else { return false; }; if (typeof test.postorder !== ''function'') { return false; }; return (test.postorder() == null); })(), ''The postorder method returns null for an empty tree.'');' + testString: 'assert((function() { var test = false; if (typeof BinarySearchTree !== "undefined") { test = new BinarySearchTree() } else { return false; }; if (typeof test.postorder !== "function") { return false; }; return (test.postorder() == null); })(), "The postorder method returns null for an empty tree.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/data-structures/use-spread-and-notes-for-es5-set-integration.english.md b/curriculum/challenges/english/08-coding-interview-prep/data-structures/use-spread-and-notes-for-es5-set-integration.english.md index 3e99e865fc..7060446cae 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/data-structures/use-spread-and-notes-for-es5-set-integration.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/data-structures/use-spread-and-notes-for-es5-set-integration.english.md @@ -24,7 +24,7 @@ Now you've successfully learned how to use the ES6 Set() object, go ```yml tests: - text: Your Set was returned correctly! - testString: 'assert(function(){var test = checkSet(new Set([1,2,3,4,5,6,7])); test === [ 1, 2, 3, 4, 5, 6, 7 ]}, ''Your Set was returned correctly!'');' + testString: 'assert(function(){var test = checkSet(new Set([1,2,3,4,5,6,7])); test === [ 1, 2, 3, 4, 5, 6, 7 ]}, "Your Set was returned correctly!");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/data-structures/work-with-nodes-in-a-linked-list.english.md b/curriculum/challenges/english/08-coding-interview-prep/data-structures/work-with-nodes-in-a-linked-list.english.md index b149428fe8..d232f82731 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/data-structures/work-with-nodes-in-a-linked-list.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/data-structures/work-with-nodes-in-a-linked-list.english.md @@ -22,9 +22,9 @@ Create a Cat and Dog node and manually add them to the ```yml tests: - text: Your Puppy node should have a reference to a Cat node. - testString: 'assert(Puppy.next.element === "Cat", ''Your Puppy node should have a reference to a Cat node.'');' + testString: 'assert(Puppy.next.element === "Cat", "Your Puppy node should have a reference to a Cat node.");' - text: Your Cat node should have a reference to a Dog node. - testString: 'assert(Cat.next.element === "Dog", ''Your Cat node should have a reference to a Dog node.'');' + testString: 'assert(Cat.next.element === "Dog", "Your Cat node should have a reference to a Dog node.");' ``` @@ -37,8 +37,8 @@ tests: ```js var Node = function(element){ - this.element = element; - this.next = null; + this.element = element; + this.next = null; }; var Kitten = new Node("Kitten"); var Puppy = new Node("Puppy"); diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-1-multiples-of-3-and-5.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-1-multiples-of-3-and-5.english.md index 58fd0403a8..9fef3e1f60 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-1-multiples-of-3-and-5.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-1-multiples-of-3-and-5.english.md @@ -21,13 +21,13 @@ Find the sum of all the multiples of 3 or 5 below the provided parameter value < ```yml tests: - text: multiplesOf3and5(1000) should return 233168. - testString: 'assert.strictEqual(multiplesOf3and5(1000), 233168, ''multiplesOf3and5(1000) should return 233168.'');' + testString: 'assert.strictEqual(multiplesOf3and5(1000), 233168, "multiplesOf3and5(1000) should return 233168.");' - text: multiplesOf3and5(49) should return 543. - testString: 'assert.strictEqual(multiplesOf3and5(49), 543, ''multiplesOf3and5(49) should return 543.'');' + testString: 'assert.strictEqual(multiplesOf3and5(49), 543, "multiplesOf3and5(49) should return 543.");' - text: multiplesOf3and5(19564) should return 89301183. - testString: 'assert.strictEqual(multiplesOf3and5(19564), 89301183, ''multiplesOf3and5(19564) should return 89301183.'');' + testString: 'assert.strictEqual(multiplesOf3and5(19564), 89301183, "multiplesOf3and5(19564) should return 89301183.");' - text: Your function is not returning the correct result using our tests values. - testString: 'assert.strictEqual(multiplesOf3and5(8456), 16687353, ''Your function is not returning the correct result using our tests values.'');' + testString: 'assert.strictEqual(multiplesOf3and5(8456), 16687353, "Your function is not returning the correct result using our tests values.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-10-summation-of-primes.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-10-summation-of-primes.english.md index cf04b6c70e..48b3043d82 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-10-summation-of-primes.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-10-summation-of-primes.english.md @@ -21,13 +21,13 @@ Find the sum of all the primes below n. ```yml tests: - text: primeSummation(17) should return 41. - testString: 'assert.strictEqual(primeSummation(17), 41, ''primeSummation(17) should return 41.'');' + testString: 'assert.strictEqual(primeSummation(17), 41, "primeSummation(17) should return 41.");' - text: primeSummation(2001) should return 277050. - testString: 'assert.strictEqual(primeSummation(2001), 277050, ''primeSummation(2001) should return 277050.'');' + testString: 'assert.strictEqual(primeSummation(2001), 277050, "primeSummation(2001) should return 277050.");' - text: primeSummation(140759) should return 873608362. - testString: 'assert.strictEqual(primeSummation(140759), 873608362, ''primeSummation(140759) should return 873608362.'');' + testString: 'assert.strictEqual(primeSummation(140759), 873608362, "primeSummation(140759) should return 873608362.");' - text: primeSummation(2000000) should return 142913828922. - testString: 'assert.strictEqual(primeSummation(2000000), 142913828922, ''primeSummation(2000000) should return 142913828922.'');' + testString: 'assert.strictEqual(primeSummation(2000000), 142913828922, "primeSummation(2000000) should return 142913828922.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-100-arranged-probability.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-100-arranged-probability.english.md index 41fb489cd7..4efb3b48cb 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-100-arranged-probability.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-100-arranged-probability.english.md @@ -22,7 +22,7 @@ By finding the first arrangement to contain over 1012 = 1,000,000,000,000 discs ```yml tests: - text: euler100() should return 756872327473. - testString: 'assert.strictEqual(euler100(), 756872327473, ''euler100() should return 756872327473.'');' + testString: 'assert.strictEqual(euler100(), 756872327473, "euler100() should return 756872327473.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-101-optimum-polynomial.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-101-optimum-polynomial.english.md index d7caa0893d..f5c1db5b4b 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-101-optimum-polynomial.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-101-optimum-polynomial.english.md @@ -40,7 +40,7 @@ Find the sum of FITs for the BOPs. ```yml tests: - text: euler101() should return 37076114526. - testString: 'assert.strictEqual(euler101(), 37076114526, ''euler101() should return 37076114526.'');' + testString: 'assert.strictEqual(euler101(), 37076114526, "euler101() should return 37076114526.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-102-triangle-containment.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-102-triangle-containment.english.md index 7f832d7e47..db5dd1fa34 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-102-triangle-containment.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-102-triangle-containment.english.md @@ -26,7 +26,7 @@ NOTE: The first two examples in the file represent the triangles in the example ```yml tests: - text: euler102() should return 228. - testString: 'assert.strictEqual(euler102(), 228, ''euler102() should return 228.'');' + testString: 'assert.strictEqual(euler102(), 228, "euler102() should return 228.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-103-special-subset-sums-optimum.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-103-special-subset-sums-optimum.english.md index 6eeda60ecb..caf6f0ecd2 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-103-special-subset-sums-optimum.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-103-special-subset-sums-optimum.english.md @@ -28,7 +28,7 @@ NOTE: This problem is related to Problem 105 and Problem 106. ```yml tests: - text: euler103() should return 20313839404245. - testString: 'assert.strictEqual(euler103(), 20313839404245, ''euler103() should return 20313839404245.'');' + testString: 'assert.strictEqual(euler103(), 20313839404245, "euler103() should return 20313839404245.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-104-pandigital-fibonacci-ends.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-104-pandigital-fibonacci-ends.english.md index 7a7b220609..cbe01a7e2a 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-104-pandigital-fibonacci-ends.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-104-pandigital-fibonacci-ends.english.md @@ -23,7 +23,7 @@ Given that Fk is the first Fibonacci number for which the first nine digits AND ```yml tests: - text: euler104() should return 329468. - testString: 'assert.strictEqual(euler104(), 329468, ''euler104() should return 329468.'');' + testString: 'assert.strictEqual(euler104(), 329468, "euler104() should return 329468.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-105-special-subset-sums-testing.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-105-special-subset-sums-testing.english.md index b3c76beddc..c9d3ba4096 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-105-special-subset-sums-testing.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-105-special-subset-sums-testing.english.md @@ -25,7 +25,7 @@ NOTE: This problem is related to Problem 103 and Problem 106. ```yml tests: - text: euler105() should return 73702. - testString: 'assert.strictEqual(euler105(), 73702, ''euler105() should return 73702.'');' + testString: 'assert.strictEqual(euler105(), 73702, "euler105() should return 73702.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-106-special-subset-sums-meta-testing.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-106-special-subset-sums-meta-testing.english.md index 972860e9dd..b5c5079546 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-106-special-subset-sums-meta-testing.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-106-special-subset-sums-meta-testing.english.md @@ -26,7 +26,7 @@ NOTE: This problem is related to Problem 103 and Problem 105. ```yml tests: - text: euler106() should return 21384. - testString: 'assert.strictEqual(euler106(), 21384, ''euler106() should return 21384.'');' + testString: 'assert.strictEqual(euler106(), 21384, "euler106() should return 21384.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-107-minimal-network.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-107-minimal-network.english.md index 288aa276cc..ded306953c 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-107-minimal-network.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-107-minimal-network.english.md @@ -35,7 +35,7 @@ Using network.txt (right click and 'Save Link/Target As...'), a 6K text file con ```yml tests: - text: euler107() should return 259679. - testString: 'assert.strictEqual(euler107(), 259679, ''euler107() should return 259679.'');' + testString: 'assert.strictEqual(euler107(), 259679, "euler107() should return 259679.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-108-diophantine-reciprocals-i.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-108-diophantine-reciprocals-i.english.md index be91f84f59..e26cbfc246 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-108-diophantine-reciprocals-i.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-108-diophantine-reciprocals-i.english.md @@ -24,7 +24,7 @@ What is the least value of n for which the number of distinct solutio ```yml tests: - text: diophantineOne() should return 180180. - testString: 'assert.strictEqual(diophantineOne(), 180180, ''diophantineOne() should return 180180.'');' + testString: 'assert.strictEqual(diophantineOne(), 180180, "diophantineOne() should return 180180.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-109-darts.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-109-darts.english.md index 301297c99f..ac43195497 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-109-darts.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-109-darts.english.md @@ -66,7 +66,7 @@ How many distinct ways can a player checkout with a score less than 100? ```yml tests: - text: euler109() should return 38182. - testString: 'assert.strictEqual(euler109(), 38182, ''euler109() should return 38182.'');' + testString: 'assert.strictEqual(euler109(), 38182, "euler109() should return 38182.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-11-largest-product-in-a-grid.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-11-largest-product-in-a-grid.english.md index 20dc36541e..1caf751f26 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-11-largest-product-in-a-grid.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-11-largest-product-in-a-grid.english.md @@ -44,9 +44,9 @@ What is the greatest product of four adjacent numbers in the same direction (up, ```yml tests: - text: largestGridProduct(grid) should return 70600674. - testString: 'assert.strictEqual(largestGridProduct(grid), 70600674, ''largestGridProduct(grid) should return 70600674.'');' + testString: 'assert.strictEqual(largestGridProduct(grid), 70600674, "largestGridProduct(grid) should return 70600674.");' - text: largestGridProduct(testGrid) should return 14169081. - testString: 'assert.strictEqual(largestGridProduct(testGrid), 14169081, ''largestGridProduct(testGrid) should return 14169081.'');' + testString: 'assert.strictEqual(largestGridProduct(testGrid), 14169081, "largestGridProduct(testGrid) should return 14169081.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-110-diophantine-reciprocals-ii.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-110-diophantine-reciprocals-ii.english.md index 775d8c4864..e3dfe83a41 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-110-diophantine-reciprocals-ii.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-110-diophantine-reciprocals-ii.english.md @@ -23,7 +23,7 @@ What is the least value of n for which the number of distinct solutio ```yml tests: - text: diophantineTwo should return 9350130049860600. - testString: 'assert.strictEqual(diophantineTwo(), 9350130049860600, ''diophantineTwo() should return 9350130049860600.'');' + testString: 'assert.strictEqual(diophantineTwo(), 9350130049860600, "diophantineTwo() should return 9350130049860600.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-111-primes-with-runs.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-111-primes-with-runs.english.md index 970ed17fb4..e162effe19 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-111-primes-with-runs.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-111-primes-with-runs.english.md @@ -72,7 +72,7 @@ Find the sum of all S(10, d). ```yml tests: - text: euler111() should return 612407567715. - testString: 'assert.strictEqual(euler111(), 612407567715, ''euler111() should return 612407567715.'');' + testString: 'assert.strictEqual(euler111(), 612407567715, "euler111() should return 612407567715.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-112-bouncy-numbers.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-112-bouncy-numbers.english.md index 91e9c5a206..e1cb1c7165 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-112-bouncy-numbers.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-112-bouncy-numbers.english.md @@ -25,7 +25,7 @@ Find the least number for which the proportion of bouncy numbers is exactly 99%. ```yml tests: - text: euler112() should return 1587000. - testString: 'assert.strictEqual(euler112(), 1587000, ''euler112() should return 1587000.'');' + testString: 'assert.strictEqual(euler112(), 1587000, "euler112() should return 1587000.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-113-non-bouncy-numbers.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-113-non-bouncy-numbers.english.md index a6ac64af21..75bd210bf1 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-113-non-bouncy-numbers.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-113-non-bouncy-numbers.english.md @@ -24,7 +24,7 @@ How many numbers below a googol (10100) are not bouncy? ```yml tests: - text: euler113() should return 51161058134250. - testString: 'assert.strictEqual(euler113(), 51161058134250, ''euler113() should return 51161058134250.'');' + testString: 'assert.strictEqual(euler113(), 51161058134250, "euler113() should return 51161058134250.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-114-counting-block-combinations-i.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-114-counting-block-combinations-i.english.md index a219516b33..38a47f4aba 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-114-counting-block-combinations-i.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-114-counting-block-combinations-i.english.md @@ -123,7 +123,7 @@ NOTE: Although the example above does not lend itself to the possibility, in gen ```yml tests: - text: euler114() should return 16475640049. - testString: 'assert.strictEqual(euler114(), 16475640049, ''euler114() should return 16475640049.'');' + testString: 'assert.strictEqual(euler114(), 16475640049, "euler114() should return 16475640049.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-115-counting-block-combinations-ii.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-115-counting-block-combinations-ii.english.md index 424ee8641c..189059a775 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-115-counting-block-combinations-ii.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-115-counting-block-combinations-ii.english.md @@ -26,7 +26,7 @@ For m = 50, find the least value of n for which the fill-count function first ex ```yml tests: - text: euler115() should return 168. - testString: 'assert.strictEqual(euler115(), 168, ''euler115() should return 168.'');' + testString: 'assert.strictEqual(euler115(), 168, "euler115() should return 168.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-116-red-green-or-blue-tiles.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-116-red-green-or-blue-tiles.english.md index 3b835d9bde..075a22b2c9 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-116-red-green-or-blue-tiles.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-116-red-green-or-blue-tiles.english.md @@ -93,7 +93,7 @@ NOTE: This is related to Problem 117. ```yml tests: - text: euler116() should return 20492570929. - testString: 'assert.strictEqual(euler116(), 20492570929, ''euler116() should return 20492570929.'');' + testString: 'assert.strictEqual(euler116(), 20492570929, "euler116() should return 20492570929.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-117-red-green-and-blue-tiles.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-117-red-green-and-blue-tiles.english.md index 2ffdcfba68..cb87e8fd11 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-117-red-green-and-blue-tiles.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-117-red-green-and-blue-tiles.english.md @@ -101,7 +101,7 @@ NOTE: This is related to Problem 116. ```yml tests: - text: euler117() should return 100808458960497. - testString: 'assert.strictEqual(euler117(), 100808458960497, ''euler117() should return 100808458960497.'');' + testString: 'assert.strictEqual(euler117(), 100808458960497, "euler117() should return 100808458960497.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-118-pandigital-prime-sets.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-118-pandigital-prime-sets.english.md index 3f5d6ff2da..ade9d2ea18 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-118-pandigital-prime-sets.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-118-pandigital-prime-sets.english.md @@ -21,7 +21,7 @@ How many distinct sets containing each of the digits one through nine exactly on ```yml tests: - text: euler118() should return 44680. - testString: 'assert.strictEqual(euler118(), 44680, ''euler118() should return 44680.'');' + testString: 'assert.strictEqual(euler118(), 44680, "euler118() should return 44680.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-119-digit-power-sum.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-119-digit-power-sum.english.md index 486f7e2181..1dd763477a 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-119-digit-power-sum.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-119-digit-power-sum.english.md @@ -23,7 +23,7 @@ Find a30. ```yml tests: - text: euler119() should return 248155780267521. - testString: 'assert.strictEqual(euler119(), 248155780267521, ''euler119() should return 248155780267521.'');' + testString: 'assert.strictEqual(euler119(), 248155780267521, "euler119() should return 248155780267521.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-12-highly-divisible-triangular-number.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-12-highly-divisible-triangular-number.english.md index d3900a020c..38900c0865 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-12-highly-divisible-triangular-number.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-12-highly-divisible-triangular-number.english.md @@ -31,15 +31,15 @@ What is the value of the first triangle number to have over n divis ```yml tests: - text: divisibleTriangleNumber(5) should return 28. - testString: 'assert.strictEqual(divisibleTriangleNumber(5), 28, ''divisibleTriangleNumber(5) should return 28.'');' + testString: 'assert.strictEqual(divisibleTriangleNumber(5), 28, "divisibleTriangleNumber(5) should return 28.");' - text: divisibleTriangleNumber(23) should return 630. - testString: 'assert.strictEqual(divisibleTriangleNumber(23), 630, ''divisibleTriangleNumber(23) should return 630.'');' + testString: 'assert.strictEqual(divisibleTriangleNumber(23), 630, "divisibleTriangleNumber(23) should return 630.");' - text: divisibleTriangleNumber(167) should return 1385280. - testString: 'assert.strictEqual(divisibleTriangleNumber(167), 1385280, ''divisibleTriangleNumber(167) should return 1385280.'');' + testString: 'assert.strictEqual(divisibleTriangleNumber(167), 1385280, "divisibleTriangleNumber(167) should return 1385280.");' - text: divisibleTriangleNumber(374) should return 17907120. - testString: 'assert.strictEqual(divisibleTriangleNumber(374), 17907120, ''divisibleTriangleNumber(374) should return 17907120.'');' + testString: 'assert.strictEqual(divisibleTriangleNumber(374), 17907120, "divisibleTriangleNumber(374) should return 17907120.");' - text: divisibleTriangleNumber(500) should return 76576500. - testString: 'assert.strictEqual(divisibleTriangleNumber(500), 76576500, ''divisibleTriangleNumber(500) should return 76576500.'');' + testString: 'assert.strictEqual(divisibleTriangleNumber(500), 76576500, "divisibleTriangleNumber(500) should return 76576500.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-120-square-remainders.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-120-square-remainders.english.md index a8b1bc9cef..346f00e288 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-120-square-remainders.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-120-square-remainders.english.md @@ -22,7 +22,7 @@ For 3 ≤ a ≤ 1000, find ∑ rmax. ```yml tests: - text: euler120() should return 333082500. - testString: 'assert.strictEqual(euler120(), 333082500, ''euler120() should return 333082500.'');' + testString: 'assert.strictEqual(euler120(), 333082500, "euler120() should return 333082500.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-121-disc-game-prize-fund.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-121-disc-game-prize-fund.english.md index 6d002a662f..3efc3ff76a 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-121-disc-game-prize-fund.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-121-disc-game-prize-fund.english.md @@ -23,7 +23,7 @@ Find the maximum prize fund that should be allocated to a single game in which f ```yml tests: - text: euler121() should return 2269. - testString: 'assert.strictEqual(euler121(), 2269, ''euler121() should return 2269.'');' + testString: 'assert.strictEqual(euler121(), 2269, "euler121() should return 2269.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-122-efficient-exponentiation.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-122-efficient-exponentiation.english.md index 7ed76674f8..61cd1a0fd7 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-122-efficient-exponentiation.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-122-efficient-exponentiation.english.md @@ -27,7 +27,7 @@ For 1 ≤ k ≤ 200, find ∑ m(k). ```yml tests: - text: euler122() should return 1582. - testString: 'assert.strictEqual(euler122(), 1582, ''euler122() should return 1582.'');' + testString: 'assert.strictEqual(euler122(), 1582, "euler122() should return 1582.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-123-prime-square-remainders.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-123-prime-square-remainders.english.md index 73f9d94810..f4cf777b4e 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-123-prime-square-remainders.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-123-prime-square-remainders.english.md @@ -23,7 +23,7 @@ Find the least value of n for which the remainder first exceeds 1010. ```yml tests: - text: euler123() should return 21035. - testString: 'assert.strictEqual(euler123(), 21035, ''euler123() should return 21035.'');' + testString: 'assert.strictEqual(euler123(), 21035, "euler123() should return 21035.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-124-ordered-radicals.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-124-ordered-radicals.english.md index 89d245c355..c38000a191 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-124-ordered-radicals.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-124-ordered-radicals.english.md @@ -62,7 +62,7 @@ If rad(n) is sorted for 1 ≤ n ≤ 100000, find E(10000). ```yml tests: - text: euler124() should return 21417. - testString: 'assert.strictEqual(euler124(), 21417, ''euler124() should return 21417.'');' + testString: 'assert.strictEqual(euler124(), 21417, "euler124() should return 21417.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-125-palindromic-sums.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-125-palindromic-sums.english.md index 78e8df6b8b..16ff57d45b 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-125-palindromic-sums.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-125-palindromic-sums.english.md @@ -22,7 +22,7 @@ Find the sum of all the numbers less than 108 that are both palindromic and can ```yml tests: - text: euler125() should return 2906969179. - testString: 'assert.strictEqual(euler125(), 2906969179, ''euler125() should return 2906969179.'');' + testString: 'assert.strictEqual(euler125(), 2906969179, "euler125() should return 2906969179.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-126-cuboid-layers.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-126-cuboid-layers.english.md index 89a1ba0f57..8b1588f553 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-126-cuboid-layers.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-126-cuboid-layers.english.md @@ -27,7 +27,7 @@ Find the least value of n for which C(n) = 1000. ```yml tests: - text: euler126() should return 18522. - testString: 'assert.strictEqual(euler126(), 18522, ''euler126() should return 18522.'');' + testString: 'assert.strictEqual(euler126(), 18522, "euler126() should return 18522.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-127-abc-hits.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-127-abc-hits.english.md index d3caf09e89..c44437ff4f 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-127-abc-hits.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-127-abc-hits.english.md @@ -32,7 +32,7 @@ Find ∑c for c < 120000. ```yml tests: - text: euler127() should return 18407904. - testString: 'assert.strictEqual(euler127(), 18407904, ''euler127() should return 18407904.'');' + testString: 'assert.strictEqual(euler127(), 18407904, "euler127() should return 18407904.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-128-hexagonal-tile-differences.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-128-hexagonal-tile-differences.english.md index 18d0f69c91..1e7a1d3339 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-128-hexagonal-tile-differences.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-128-hexagonal-tile-differences.english.md @@ -29,7 +29,7 @@ Find the 2000th tile in this sequence. ```yml tests: - text: euler128() should return 14516824220. - testString: 'assert.strictEqual(euler128(), 14516824220, ''euler128() should return 14516824220.'');' + testString: 'assert.strictEqual(euler128(), 14516824220, "euler128() should return 14516824220.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-129-repunit-divisibility.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-129-repunit-divisibility.english.md index 42d23bbb82..eef8890445 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-129-repunit-divisibility.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-129-repunit-divisibility.english.md @@ -23,7 +23,7 @@ Find the least value of n for which A(n) first exceeds one-million. ```yml tests: - text: euler129() should return 1000023. - testString: 'assert.strictEqual(euler129(), 1000023, ''euler129() should return 1000023.'');' + testString: 'assert.strictEqual(euler129(), 1000023, "euler129() should return 1000023.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-13-large-sum.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-13-large-sum.english.md index 07be516276..04ed350f5c 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-13-large-sum.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-13-large-sum.english.md @@ -121,9 +121,9 @@ Work out the first ten digits of the sum of the following one-hundred 50-digit n ```yml tests: - text: largeSum(testNums) should return 8348422521. - testString: 'assert.strictEqual(largeSum(testNums), 8348422521, ''largeSum(testNums) should return 8348422521.'');' + testString: 'assert.strictEqual(largeSum(testNums), 8348422521, "largeSum(testNums) should return 8348422521.");' - text: largeSum(fiftyDigitNums) should return 5537376230. - testString: 'assert.strictEqual(largeSum(fiftyDigitNums), 5537376230, ''largeSum(fiftyDigitNums) should return 5537376230.'');' + testString: 'assert.strictEqual(largeSum(fiftyDigitNums), 5537376230, "largeSum(fiftyDigitNums) should return 5537376230.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-130-composites-with-prime-repunit-property.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-130-composites-with-prime-repunit-property.english.md index 453a8c7c9f..efdfc4887e 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-130-composites-with-prime-repunit-property.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-130-composites-with-prime-repunit-property.english.md @@ -24,7 +24,7 @@ Find the sum of the first twenty-five composite values of n for whichGCD(n, 10) ```yml tests: - text: euler130() should return 149253. - testString: 'assert.strictEqual(euler130(), 149253, ''euler130() should return 149253.'');' + testString: 'assert.strictEqual(euler130(), 149253, "euler130() should return 149253.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-131-prime-cube-partnership.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-131-prime-cube-partnership.english.md index 4820ac52fe..5a1a0ed528 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-131-prime-cube-partnership.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-131-prime-cube-partnership.english.md @@ -23,7 +23,7 @@ How many primes below one million have this remarkable property? ```yml tests: - text: euler131() should return 173. - testString: 'assert.strictEqual(euler131(), 173, ''euler131() should return 173.'');' + testString: 'assert.strictEqual(euler131(), 173, "euler131() should return 173.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-132-large-repunit-factors.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-132-large-repunit-factors.english.md index 41ce87535a..f12fe11b28 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-132-large-repunit-factors.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-132-large-repunit-factors.english.md @@ -22,7 +22,7 @@ Find the sum of the first forty prime factors of R(109). ```yml tests: - text: euler132() should return 843296. - testString: 'assert.strictEqual(euler132(), 843296, ''euler132() should return 843296.'');' + testString: 'assert.strictEqual(euler132(), 843296, "euler132() should return 843296.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-133-repunit-nonfactors.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-133-repunit-nonfactors.english.md index 0e5153caf1..01f3f15441 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-133-repunit-nonfactors.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-133-repunit-nonfactors.english.md @@ -23,7 +23,7 @@ Find the sum of all the primes below one-hundred thousand that will never be a f ```yml tests: - text: euler133() should return 453647705. - testString: 'assert.strictEqual(euler133(), 453647705, ''euler133() should return 453647705.'');' + testString: 'assert.strictEqual(euler133(), 453647705, "euler133() should return 453647705.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-134-prime-pair-connection.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-134-prime-pair-connection.english.md index f850e908bc..a8165044aa 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-134-prime-pair-connection.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-134-prime-pair-connection.english.md @@ -22,7 +22,7 @@ Find ∑ S for every pair of consecutive primes with 5 ≤ p1 ≤ 1000000. ```yml tests: - text: euler134() should return 18613426663617120. - testString: 'assert.strictEqual(euler134(), 18613426663617120, ''euler134() should return 18613426663617120.'');' + testString: 'assert.strictEqual(euler134(), 18613426663617120, "euler134() should return 18613426663617120.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-135-same-differences.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-135-same-differences.english.md index 431b9d0910..dcf4b6aa1e 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-135-same-differences.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-135-same-differences.english.md @@ -23,7 +23,7 @@ How many values of n less than one million have exactly ten distinct solutions? ```yml tests: - text: euler135() should return 4989. - testString: 'assert.strictEqual(euler135(), 4989, ''euler135() should return 4989.'');' + testString: 'assert.strictEqual(euler135(), 4989, "euler135() should return 4989.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-136-singleton-difference.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-136-singleton-difference.english.md index 71765da65f..cbbb6f12b4 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-136-singleton-difference.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-136-singleton-difference.english.md @@ -23,7 +23,7 @@ How many values of n less than fifty million have exactly one solution? ```yml tests: - text: euler136() should return 2544559. - testString: 'assert.strictEqual(euler136(), 2544559, ''euler136() should return 2544559.'');' + testString: 'assert.strictEqual(euler136(), 2544559, "euler136() should return 2544559.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-137-fibonacci-golden-nuggets.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-137-fibonacci-golden-nuggets.english.md index 1d736ee33f..a20f540c41 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-137-fibonacci-golden-nuggets.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-137-fibonacci-golden-nuggets.english.md @@ -41,7 +41,7 @@ Find the 15th golden nugget. ```yml tests: - text: euler137() should return 1120149658760. - testString: 'assert.strictEqual(euler137(), 1120149658760, ''euler137() should return 1120149658760.'');' + testString: 'assert.strictEqual(euler137(), 1120149658760, "euler137() should return 1120149658760.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-138-special-isosceles-triangles.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-138-special-isosceles-triangles.english.md index 16fac9b50a..cb10b7d3ea 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-138-special-isosceles-triangles.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-138-special-isosceles-triangles.english.md @@ -25,7 +25,7 @@ Find ∑ L for the twelve smallest isosceles triangles for which h = b ± 1 and ```yml tests: - text: euler138() should return 1118049290473932. - testString: 'assert.strictEqual(euler138(), 1118049290473932, ''euler138() should return 1118049290473932.'');' + testString: 'assert.strictEqual(euler138(), 1118049290473932, "euler138() should return 1118049290473932.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-139-pythagorean-tiles.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-139-pythagorean-tiles.english.md index 72602de547..98a1c91ca6 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-139-pythagorean-tiles.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-139-pythagorean-tiles.english.md @@ -25,7 +25,7 @@ Given that the perimeter of the right triangle is less than one-hundred million, ```yml tests: - text: euler139() should return 10057761. - testString: 'assert.strictEqual(euler139(), 10057761, ''euler139() should return 10057761.'');' + testString: 'assert.strictEqual(euler139(), 10057761, "euler139() should return 10057761.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-14-longest-collatz-sequence.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-14-longest-collatz-sequence.english.md index da2b8bc532..71e9c5d934 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-14-longest-collatz-sequence.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-14-longest-collatz-sequence.english.md @@ -27,15 +27,15 @@ NOTE: Once the chain starts the terms are allowed to go above one million. ```yml tests: - text: longestCollatzSequence(14) should return 9. - testString: 'assert.strictEqual(longestCollatzSequence(14), 9, ''longestCollatzSequence(14) should return 9.'');' + testString: 'assert.strictEqual(longestCollatzSequence(14), 9, "longestCollatzSequence(14) should return 9.");' - text: longestCollatzSequence(5847) should return 3711. - testString: 'assert.strictEqual(longestCollatzSequence(5847), 3711, ''longestCollatzSequence(5847) should return 3711.'');' + testString: 'assert.strictEqual(longestCollatzSequence(5847), 3711, "longestCollatzSequence(5847) should return 3711.");' - text: longestCollatzSequence(46500) should return 35655. - testString: 'assert.strictEqual(longestCollatzSequence(46500), 35655, ''longestCollatzSequence(46500) should return 35655.'');' + testString: 'assert.strictEqual(longestCollatzSequence(46500), 35655, "longestCollatzSequence(46500) should return 35655.");' - text: longestCollatzSequence(54512) should return 52527. - testString: 'assert.strictEqual(longestCollatzSequence(54512), 52527, ''longestCollatzSequence(54512) should return 52527.'');' + testString: 'assert.strictEqual(longestCollatzSequence(54512), 52527, "longestCollatzSequence(54512) should return 52527.");' - text: longestCollatzSequence(1000000) should return 837799. - testString: 'assert.strictEqual(longestCollatzSequence(1000000), 837799, ''longestCollatzSequence(1000000) should return 837799.'');' + testString: 'assert.strictEqual(longestCollatzSequence(1000000), 837799, "longestCollatzSequence(1000000) should return 837799.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-140-modified-fibonacci-golden-nuggets.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-140-modified-fibonacci-golden-nuggets.english.md index 7bef8f11d9..3c00cfd31f 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-140-modified-fibonacci-golden-nuggets.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-140-modified-fibonacci-golden-nuggets.english.md @@ -32,7 +32,7 @@ Find the sum of the first thirty golden nuggets. ```yml tests: - text: euler140() should return 5673835352990. - testString: 'assert.strictEqual(euler140(), 5673835352990, ''euler140() should return 5673835352990.'');' + testString: 'assert.strictEqual(euler140(), 5673835352990, "euler140() should return 5673835352990.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-141-investigating-progressive-numbers-n-which-are-also-square.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-141-investigating-progressive-numbers-n-which-are-also-square.english.md index e9f6748b95..6657a4eeda 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-141-investigating-progressive-numbers-n-which-are-also-square.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-141-investigating-progressive-numbers-n-which-are-also-square.english.md @@ -24,7 +24,7 @@ Find the sum of all progressive perfect squares below one trillion (1012). ```yml tests: - text: euler141() should return 878454337159. - testString: 'assert.strictEqual(euler141(), 878454337159, ''euler141() should return 878454337159.'');' + testString: 'assert.strictEqual(euler141(), 878454337159, "euler141() should return 878454337159.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-142-perfect-square-collection.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-142-perfect-square-collection.english.md index bd4f87bfdd..cdd317ed68 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-142-perfect-square-collection.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-142-perfect-square-collection.english.md @@ -20,7 +20,7 @@ Find the smallest x + y + z with integers x > y > z > 0 such that x + y, x − y ```yml tests: - text: euler142() should return 1006193. - testString: 'assert.strictEqual(euler142(), 1006193, ''euler142() should return 1006193.'');' + testString: 'assert.strictEqual(euler142(), 1006193, "euler142() should return 1006193.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-143-investigating-the-torricelli-point-of-a-triangle.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-143-investigating-the-torricelli-point-of-a-triangle.english.md index 4db9e6c3a5..3a49430b12 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-143-investigating-the-torricelli-point-of-a-triangle.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-143-investigating-the-torricelli-point-of-a-triangle.english.md @@ -25,7 +25,7 @@ Find the sum of all distinct values of p + q + r ≤ 120000 for Torricelli trian ```yml tests: - text: euler143() should return 30758397. - testString: 'assert.strictEqual(euler143(), 30758397, ''euler143() should return 30758397.'');' + testString: 'assert.strictEqual(euler143(), 30758397, "euler143() should return 30758397.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-144-investigating-multiple-reflections-of-a-laser-beam.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-144-investigating-multiple-reflections-of-a-laser-beam.english.md index 87f6aaf223..7e47d72ff9 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-144-investigating-multiple-reflections-of-a-laser-beam.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-144-investigating-multiple-reflections-of-a-laser-beam.english.md @@ -29,7 +29,7 @@ How many times does the beam hit the internal surface of the white cell before e ```yml tests: - text: euler144() should return 354. - testString: 'assert.strictEqual(euler144(), 354, ''euler144() should return 354.'');' + testString: 'assert.strictEqual(euler144(), 354, "euler144() should return 354.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-145-how-many-reversible-numbers-are-there-below-one-billion.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-145-how-many-reversible-numbers-are-there-below-one-billion.english.md index 806af30fd8..ca1e838a77 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-145-how-many-reversible-numbers-are-there-below-one-billion.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-145-how-many-reversible-numbers-are-there-below-one-billion.english.md @@ -24,7 +24,7 @@ How many reversible numbers are there below one-billion (109)? ```yml tests: - text: euler145() should return 608720. - testString: 'assert.strictEqual(euler145(), 608720, ''euler145() should return 608720.'');' + testString: 'assert.strictEqual(euler145(), 608720, "euler145() should return 608720.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-146-investigating-a-prime-pattern.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-146-investigating-a-prime-pattern.english.md index eb68f369c3..1919672471 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-146-investigating-a-prime-pattern.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-146-investigating-a-prime-pattern.english.md @@ -22,7 +22,7 @@ What is the sum of all such integers n below 150 million? ```yml tests: - text: euler146() should return 676333270. - testString: 'assert.strictEqual(euler146(), 676333270, ''euler146() should return 676333270.'');' + testString: 'assert.strictEqual(euler146(), 676333270, "euler146() should return 676333270.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-147-rectangles-in-cross-hatched-grids.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-147-rectangles-in-cross-hatched-grids.english.md index 9ad574c102..ed983ef00a 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-147-rectangles-in-cross-hatched-grids.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-147-rectangles-in-cross-hatched-grids.english.md @@ -31,7 +31,7 @@ How many different rectangles could be situated within 47x43 and smaller grids? ```yml tests: - text: euler147() should return 846910284. - testString: 'assert.strictEqual(euler147(), 846910284, ''euler147() should return 846910284.'');' + testString: 'assert.strictEqual(euler147(), 846910284, "euler147() should return 846910284.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-148-exploring-pascals-triangle.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-148-exploring-pascals-triangle.english.md index 721d405768..dac2ed8450 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-148-exploring-pascals-triangle.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-148-exploring-pascals-triangle.english.md @@ -1,7 +1,7 @@ --- id: 5900f4021000cf542c50ff14 challengeType: 5 -title: 'Problem 148: Exploring Pascal''s triangle' +title: 'Problem 148: Exploring Pascal"s triangle' --- ## Description @@ -93,7 +93,7 @@ Find the number of entries which are not divisible by 7 in the first one billion ```yml tests: - text: euler148() should return 2129970655314432. - testString: 'assert.strictEqual(euler148(), 2129970655314432, ''euler148() should return 2129970655314432.'');' + testString: 'assert.strictEqual(euler148(), 2129970655314432, "euler148() should return 2129970655314432.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-149-searching-for-a-maximum-sum-subsequence.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-149-searching-for-a-maximum-sum-subsequence.english.md index ff82855256..ed9724566d 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-149-searching-for-a-maximum-sum-subsequence.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-149-searching-for-a-maximum-sum-subsequence.english.md @@ -36,7 +36,7 @@ Finally, find the greatest sum of (any number of) adjacent entries in any direct ```yml tests: - text: euler149() should return 52852124. - testString: 'assert.strictEqual(euler149(), 52852124, ''euler149() should return 52852124.'');' + testString: 'assert.strictEqual(euler149(), 52852124, "euler149() should return 52852124.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-15-lattice-paths.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-15-lattice-paths.english.md index ca9508f840..8f5e0af317 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-15-lattice-paths.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-15-lattice-paths.english.md @@ -24,11 +24,11 @@ How many such routes are there through a given gridSize? ```yml tests: - text: latticePaths(4) should return 70. - testString: 'assert.strictEqual(latticePaths(4), 70, ''latticePaths(4) should return 70.'');' + testString: 'assert.strictEqual(latticePaths(4), 70, "latticePaths(4) should return 70.");' - text: latticePaths(9) should return 48620. - testString: 'assert.strictEqual(latticePaths(9), 48620, ''latticePaths(9) should return 48620.'');' + testString: 'assert.strictEqual(latticePaths(9), 48620, "latticePaths(9) should return 48620.");' - text: latticePaths(20) should return 137846528820. - testString: 'assert.strictEqual(latticePaths(20), 137846528820, ''latticePaths(20) should return 137846528820.'');' + testString: 'assert.strictEqual(latticePaths(20), 137846528820, "latticePaths(20) should return 137846528820.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-150-searching-a-triangular-array-for-a-sub-triangle-having-minimum-sum.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-150-searching-a-triangular-array-for-a-sub-triangle-having-minimum-sum.english.md index 2627a57267..f1b223dc3e 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-150-searching-a-triangular-array-for-a-sub-triangle-having-minimum-sum.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-150-searching-a-triangular-array-for-a-sub-triangle-having-minimum-sum.english.md @@ -22,7 +22,7 @@ Our triangular array is then formed using the pseudo-random numbers thus: s1 s2  s3 -s4  s5  s6  +s4  s5  s6  s7  s8  s9  s10 ... @@ -45,7 +45,7 @@ Find the smallest possible sub-triangle sum. ```yml tests: - text: euler150() should return -271248680. - testString: 'assert.strictEqual(euler150(), -271248680, ''euler150() should return -271248680.'');' + testString: 'assert.strictEqual(euler150(), -271248680, "euler150() should return -271248680.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-151-paper-sheets-of-standard-sizes-an-expected-value-problem.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-151-paper-sheets-of-standard-sizes-an-expected-value-problem.english.md index b0d71eb730..a9ebd87ed9 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-151-paper-sheets-of-standard-sizes-an-expected-value-problem.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-151-paper-sheets-of-standard-sizes-an-expected-value-problem.english.md @@ -27,7 +27,7 @@ Give your answer rounded to six decimal places using the format x.xxxxxx . ```yml tests: - text: euler151() should return 0.464399. - testString: 'assert.strictEqual(euler151(), 0.464399, ''euler151() should return 0.464399.'');' + testString: 'assert.strictEqual(euler151(), 0.464399, "euler151() should return 0.464399.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-152-writing-one-half-as-a-sum-of-inverse-squares.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-152-writing-one-half-as-a-sum-of-inverse-squares.english.md index 67e0012754..b20c6ca1b1 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-152-writing-one-half-as-a-sum-of-inverse-squares.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-152-writing-one-half-as-a-sum-of-inverse-squares.english.md @@ -24,7 +24,7 @@ How many ways are there to write the number 1/2 as a sum of inverse squares usin ```yml tests: - text: euler152() should return 301. - testString: 'assert.strictEqual(euler152(), 301, ''euler152() should return 301.'');' + testString: 'assert.strictEqual(euler152(), 301, "euler152() should return 301.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-153-investigating-gaussian-integers.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-153-investigating-gaussian-integers.english.md index 33c125d112..fa77f7518d 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-153-investigating-gaussian-integers.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-153-investigating-gaussian-integers.english.md @@ -28,7 +28,7 @@ If for example we divide 5 by 1+2i we can simplify in the following manner: Multiply numerator and denominator by the complex conjugate of 1+2i: 1−2i. -The result is +The result is . So 1+2i is a divisor of 5. @@ -64,7 +64,7 @@ What is ∑ s(n) for 1 ≤ n ≤ 108? ```yml tests: - text: euler153() should return 17971254122360636. - testString: 'assert.strictEqual(euler153(), 17971254122360636, ''euler153() should return 17971254122360636.'');' + testString: 'assert.strictEqual(euler153(), 17971254122360636, "euler153() should return 17971254122360636.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-154-exploring-pascals-pyramid.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-154-exploring-pascals-pyramid.english.md index 5994fba0d5..21c650c10a 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-154-exploring-pascals-pyramid.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-154-exploring-pascals-pyramid.english.md @@ -1,7 +1,7 @@ --- id: 5900f4071000cf542c50ff19 challengeType: 5 -title: 'Problem 154: Exploring Pascal''s pyramid' +title: 'Problem 154: Exploring Pascal"s pyramid' --- ## Description @@ -11,7 +11,7 @@ A triangular pyramid is constructed using spherical balls so that each ball rest Then, we calculate the number of paths leading from the apex to each position: A path starts at the apex and progresses downwards to any of the three spheres directly below the current position. Consequently, the number of paths to reach a certain position is the sum of the numbers immediately above it (depending on the position, there are up to three numbers above it). -The result is Pascal's pyramid and the numbers at each level n are the coefficients of the trinomial expansion +The result is Pascal's pyramid and the numbers at each level n are the coefficients of the trinomial expansion (x + y + z)n. How many coefficients in the expansion of (x + y + z)200000 are multiples of 1012? @@ -27,7 +27,7 @@ How many coefficients in the expansion of (x + y + z)200000 are multiples of 101 ```yml tests: - text: euler154() should return 479742450. - testString: 'assert.strictEqual(euler154(), 479742450, ''euler154() should return 479742450.'');' + testString: 'assert.strictEqual(euler154(), 479742450, "euler154() should return 479742450.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-155-counting-capacitor-circuits.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-155-counting-capacitor-circuits.english.md index e32d152e5e..bb2532cbf2 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-155-counting-capacitor-circuits.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-155-counting-capacitor-circuits.english.md @@ -9,7 +9,7 @@ title: 'Problem 155: Counting Capacitor Circuits' An electric circuit uses exclusively identical capacitors of the same value C. The capacitors can be connected in series or in parallel to form sub-units, which can then be connected in series or in parallel with other capacitors or other sub-units to form larger sub-units, and so on up to a final circuit. -Using this simple procedure and up to n identical capacitors, we can make circuits having a range of different total capacitances. For example, using up to n=3 capacitors of 60 F each, we can obtain the following 7 distinct total capacitance values: +Using this simple procedure and up to n identical capacitors, we can make circuits having a range of different total capacitances. For example, using up to n=3 capacitors of 60 F each, we can obtain the following 7 distinct total capacitance values: If we denote by D(n) the number of distinct total capacitance values we can obtain when using up to n equal-valued capacitors and the simple procedure described above, we have: D(1)=1, D(2)=3, D(3)=7 ... Find D(18). @@ -29,7 +29,7 @@ whereas when connecting them in series, the overall capacitance is given by: ```yml tests: - text: euler155() should return 3857447. - testString: 'assert.strictEqual(euler155(), 3857447, ''euler155() should return 3857447.'');' + testString: 'assert.strictEqual(euler155(), 3857447, "euler155() should return 3857447.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-156-counting-digits.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-156-counting-digits.english.md index b36d45c12e..97a92b3cb8 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-156-counting-digits.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-156-counting-digits.english.md @@ -52,7 +52,7 @@ Note: if, for some n, f(n,d)=n ```yml tests: - text: euler156() should return 21295121502550. - testString: 'assert.strictEqual(euler156(), 21295121502550, ''euler156() should return 21295121502550.'');' + testString: 'assert.strictEqual(euler156(), 21295121502550, "euler156() should return 21295121502550.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-157-solving-the-diophantine-equation.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-157-solving-the-diophantine-equation.english.md index 89aee32998..b869d20f0e 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-157-solving-the-diophantine-equation.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-157-solving-the-diophantine-equation.english.md @@ -42,7 +42,7 @@ How many solutions has this equation for 1 ≤ n ≤ 9? ```yml tests: - text: euler157() should return 53490. - testString: 'assert.strictEqual(euler157(), 53490, ''euler157() should return 53490.'');' + testString: 'assert.strictEqual(euler157(), 53490, "euler157() should return 53490.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-158-exploring-strings-for-which-only-one-character-comes-lexicographically-after-its-neighbour-to-the-left.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-158-exploring-strings-for-which-only-one-character-comes-lexicographically-after-its-neighbour-to-the-left.english.md index ac5ac5b815..da42075ee5 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-158-exploring-strings-for-which-only-one-character-comes-lexicographically-after-its-neighbour-to-the-left.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-158-exploring-strings-for-which-only-one-character-comes-lexicographically-after-its-neighbour-to-the-left.english.md @@ -8,11 +8,11 @@ title: 'Problem 158: Exploring strings for which only one character comes lexico
Taking three different letters from the 26 letters of the alphabet, character strings of length three can be formed. Examples are 'abc', 'hat' and 'zyx'. -When we study these three examples we see that for 'abc' two characters come lexicographically after its neighbour to the left. +When we study these three examples we see that for 'abc' two characters come lexicographically after its neighbour to the left. For 'hat' there is exactly one character that comes lexicographically after its neighbour to the left. For 'zyx' there are zero characters that come lexicographically after its neighbour to the left. In all there are 10400 strings of length 3 for which exactly one character comes lexicographically after its neighbour to the left. -We now consider strings of n ≤ 26 different characters from the alphabet. -For every n, p(n) is the number of strings of length n for which exactly one character comes lexicographically after its neighbour to the left. +We now consider strings of n ≤ 26 different characters from the alphabet. +For every n, p(n) is the number of strings of length n for which exactly one character comes lexicographically after its neighbour to the left. What is the maximum value of p(n)?
@@ -27,7 +27,7 @@ What is the maximum value of p(n)? ```yml tests: - text: euler158() should return 409511334375. - testString: 'assert.strictEqual(euler158(), 409511334375, ''euler158() should return 409511334375.'');' + testString: 'assert.strictEqual(euler158(), 409511334375, "euler158() should return 409511334375.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-159-digital-root-sums-of-factorisations.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-159-digital-root-sums-of-factorisations.english.md index b66830c353..d697b65a07 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-159-digital-root-sums-of-factorisations.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-159-digital-root-sums-of-factorisations.english.md @@ -6,7 +6,7 @@ title: 'Problem 159: Digital root sums of factorisations' ## Description
-A composite number can be factored many different ways. +A composite number can be factored many different ways. For instance, not including multiplication by one, 24 can be factored in 7 distinct ways: 24 = 2x2x2x3 @@ -17,8 +17,8 @@ For instance, not including multiplication by one, 24 can be factored in 7 disti 24 = 2x12 24 = 24 -Recall that the digital root of a number, in base 10, is found by adding together the digits of that number, -and repeating that process until a number is arrived at that is less than 10. +Recall that the digital root of a number, in base 10, is found by adding together the digits of that number, +and repeating that process until a number is arrived at that is less than 10. Thus the digital root of 467 is 8. We shall call a Digital Root Sum (DRS) the sum of the digital roots of the individual factors of our number. The chart below demonstrates all of the DRS values for 24. @@ -45,7 +45,7 @@ Find ∑mdrs(n) for 1 < n < 1,000,000. ```yml tests: - text: euler159() should return 14489159. - testString: 'assert.strictEqual(euler159(), 14489159, ''euler159() should return 14489159.'');' + testString: 'assert.strictEqual(euler159(), 14489159, "euler159() should return 14489159.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-16-power-digit-sum.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-16-power-digit-sum.english.md index 2bb3dbe9bd..0d85e5e797 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-16-power-digit-sum.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-16-power-digit-sum.english.md @@ -21,11 +21,11 @@ What is the sum of the digits of the number 2exponent? ```yml tests: - text: powerDigitSum(15) should return 26. - testString: 'assert.strictEqual(powerDigitSum(15), 26, ''powerDigitSum(15) should return 26.'');' + testString: 'assert.strictEqual(powerDigitSum(15), 26, "powerDigitSum(15) should return 26.");' - text: powerDigitSum(128) should return 166. - testString: 'assert.strictEqual(powerDigitSum(128), 166, ''powerDigitSum(128) should return 166.'');' + testString: 'assert.strictEqual(powerDigitSum(128), 166, "powerDigitSum(128) should return 166.");' - text: powerDigitSum(1000) should return 1366. - testString: 'assert.strictEqual(powerDigitSum(1000), 1366, ''powerDigitSum(1000) should return 1366.'');' + testString: 'assert.strictEqual(powerDigitSum(1000), 1366, "powerDigitSum(1000) should return 1366.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-160-factorial-trailing-digits.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-160-factorial-trailing-digits.english.md index 86ccb2a3a8..f5791b84ba 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-160-factorial-trailing-digits.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-160-factorial-trailing-digits.english.md @@ -25,7 +25,7 @@ Find f(1,000,000,000,000) ```yml tests: - text: euler160() should return 16576. - testString: 'assert.strictEqual(euler160(), 16576, ''euler160() should return 16576.'');' + testString: 'assert.strictEqual(euler160(), 16576, "euler160() should return 16576.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-161-triominoes.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-161-triominoes.english.md index bd8c75d4c5..7a5d9ffa8f 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-161-triominoes.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-161-triominoes.english.md @@ -34,7 +34,7 @@ In how many ways can a 9 by 12 grid be tiled in this way by triominoes? ```yml tests: - text: euler161() should return 20574308184277972. - testString: 'assert.strictEqual(euler161(), 20574308184277972, ''euler161() should return 20574308184277972.'');' + testString: 'assert.strictEqual(euler161(), 20574308184277972, "euler161() should return 20574308184277972.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-162-hexadecimal-numbers.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-162-hexadecimal-numbers.english.md index 6c5bf127ee..1b3c35a21c 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-162-hexadecimal-numbers.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-162-hexadecimal-numbers.english.md @@ -27,7 +27,7 @@ Give your answer as a hexadecimal number. ```yml tests: - text: euler162() should return 3D58725572C62302. - testString: 'assert.strictEqual(euler162(), 3D58725572C62302, ''euler162() should return 3D58725572C62302.'');' + testString: 'assert.strictEqual(euler162(), 3D58725572C62302, "euler162() should return 3D58725572C62302.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-163-cross-hatched-triangles.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-163-cross-hatched-triangles.english.md index 95ea411927..e109766d4c 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-163-cross-hatched-triangles.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-163-cross-hatched-triangles.english.md @@ -27,7 +27,7 @@ Find T(36). ```yml tests: - text: euler163() should return 343047. - testString: 'assert.strictEqual(euler163(), 343047, ''euler163() should return 343047.'');' + testString: 'assert.strictEqual(euler163(), 343047, "euler163() should return 343047.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-164-numbers-for-which-no-three-consecutive-digits-have-a-sum-greater-than-a-given-value.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-164-numbers-for-which-no-three-consecutive-digits-have-a-sum-greater-than-a-given-value.english.md index 92f7246d7c..6cb9cfa4c6 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-164-numbers-for-which-no-three-consecutive-digits-have-a-sum-greater-than-a-given-value.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-164-numbers-for-which-no-three-consecutive-digits-have-a-sum-greater-than-a-given-value.english.md @@ -20,7 +20,7 @@ How many 20 digit numbers n (without any leading zero) exist such that no three ```yml tests: - text: euler164() should return 378158756814587. - testString: 'assert.strictEqual(euler164(), 378158756814587, ''euler164() should return 378158756814587.'');' + testString: 'assert.strictEqual(euler164(), 378158756814587, "euler164() should return 378158756814587.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-165-intersections.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-165-intersections.english.md index 6ebec05050..2cd11be6a7 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-165-intersections.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-165-intersections.english.md @@ -6,7 +6,7 @@ title: 'Problem 165: Intersections' ## Description
-A segment is uniquely defined by its two endpoints. By considering two line segments in plane geometry there are three possibilities: +A segment is uniquely defined by its two endpoints. By considering two line segments in plane geometry there are three possibilities: the segments have zero points, one point, or infinitely many points in common. Moreover when two segments have exactly one point in common it might be the case that that common point is an endpoint of either one of the segments or of both. If a common point of two segments is not an endpoint of either of the segments it is an interior point of both segments. We will call a common point T of two segments L1 and L2 a true intersection point of L1 and L2 if T is the only common point of L1 and L2 and T is an interior point of both segments. @@ -37,7 +37,7 @@ How many distinct true intersection points are found among the 5000 line segment ```yml tests: - text: euler165() should return 2868868. - testString: 'assert.strictEqual(euler165(), 2868868, ''euler165() should return 2868868.'');' + testString: 'assert.strictEqual(euler165(), 2868868, "euler165() should return 2868868.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-166-criss-cross.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-166-criss-cross.english.md index 8dc7927b70..f2794cb156 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-166-criss-cross.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-166-criss-cross.english.md @@ -32,7 +32,7 @@ In how many ways can you fill a 4x4 grid with the digits d, 0 ≤ d ≤ 9 so tha ```yml tests: - text: euler166() should return 7130034. - testString: 'assert.strictEqual(euler166(), 7130034, ''euler166() should return 7130034.'');' + testString: 'assert.strictEqual(euler166(), 7130034, "euler166() should return 7130034.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-167-investigating-ulam-sequences.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-167-investigating-ulam-sequences.english.md index 1ff672756b..123559f6f0 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-167-investigating-ulam-sequences.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-167-investigating-ulam-sequences.english.md @@ -25,7 +25,7 @@ Find ∑U(2,2n+1)k for 2 ≤ n ≤10, where k = 1011. ```yml tests: - text: euler167() should return 3916160068885. - testString: 'assert.strictEqual(euler167(), 3916160068885, ''euler167() should return 3916160068885.'');' + testString: 'assert.strictEqual(euler167(), 3916160068885, "euler167() should return 3916160068885.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-168-number-rotations.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-168-number-rotations.english.md index fc1040928f..560bf9a111 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-168-number-rotations.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-168-number-rotations.english.md @@ -23,7 +23,7 @@ Find the last 5 digits of the sum of all integers n, 10 < n < 10100, that have t ```yml tests: - text: euler168() should return 59206. - testString: 'assert.strictEqual(euler168(), 59206, ''euler168() should return 59206.'');' + testString: 'assert.strictEqual(euler168(), 59206, "euler168() should return 59206.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-169-exploring-the-number-of-different-ways-a-number-can-be-expressed-as-a-sum-of-powers-of-2.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-169-exploring-the-number-of-different-ways-a-number-can-be-expressed-as-a-sum-of-powers-of-2.english.md index c7de3ed4b1..94ef78fdb8 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-169-exploring-the-number-of-different-ways-a-number-can-be-expressed-as-a-sum-of-powers-of-2.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-169-exploring-the-number-of-different-ways-a-number-can-be-expressed-as-a-sum-of-powers-of-2.english.md @@ -26,7 +26,7 @@ What is f(1025)? ```yml tests: - text: euler169() should return 178653872807. - testString: 'assert.strictEqual(euler169(), 178653872807, ''euler169() should return 178653872807.'');' + testString: 'assert.strictEqual(euler169(), 178653872807, "euler169() should return 178653872807.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-17-number-letter-counts.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-17-number-letter-counts.english.md index 4e87f15a80..fde34f8b5c 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-17-number-letter-counts.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-17-number-letter-counts.english.md @@ -7,7 +7,7 @@ title: 'Problem 17: Number letter counts' ## Description
If the numbers 1 to 5 are written out in words: one, two, three, four, five, then there are 3 + 3 + 5 + 4 + 4 = 19 letters used in total. -If all the numbers from 1 to given limit inclusive were written out in words, how many letters would be used? +If all the numbers from 1 to given limit inclusive were written out in words, how many letters would be used? NOTE: Do not count spaces or hyphens. For example, 342 (three hundred and forty-two) contains 23 letters and 115 (one hundred and fifteen) contains 20 letters. The use of "and" when writing out numbers is in compliance with British usage.
@@ -22,11 +22,11 @@ If all the numbers from 1 to given limit inclusive were written out ```yml tests: - text: numberLetterCounts(5) should return 19. - testString: 'assert.strictEqual(numberLetterCounts(5), 19, ''numberLetterCounts(5) should return 19.'');' + testString: 'assert.strictEqual(numberLetterCounts(5), 19, "numberLetterCounts(5) should return 19.");' - text: numberLetterCounts(150) should return 1903. - testString: 'assert.strictEqual(numberLetterCounts(150), 1903, ''numberLetterCounts(150) should return 1903.'');' + testString: 'assert.strictEqual(numberLetterCounts(150), 1903, "numberLetterCounts(150) should return 1903.");' - text: numberLetterCounts(1000) should return 21124. - testString: 'assert.strictEqual(numberLetterCounts(1000), 21124, ''numberLetterCounts(1000) should return 21124.'');' + testString: 'assert.strictEqual(numberLetterCounts(1000), 21124, "numberLetterCounts(1000) should return 21124.");' ``` @@ -59,7 +59,7 @@ numberLetterCounts(5); ```js function numberLetterCounts(limit) { const dictionary = { - 0: '', + 0: ", 1: 'one', 2: 'two', 3: 'three', @@ -90,7 +90,7 @@ function numberLetterCounts(limit) { 1000: 'onethousand' }; - let numString = ''; + let numString = "; function convertToString(num) { // check dictionary for number @@ -101,7 +101,7 @@ function numberLetterCounts(limit) { const tens = Math.floor((num / 10) % 10) * 10; const remainder = num % 10; - let tempStr = ''; + let tempStr = "; if (hundreds === 0) { tempStr += dictionary[tens] + dictionary[remainder]; diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-170-find-the-largest-0-to-9-pandigital-that-can-be-formed-by-concatenating-products.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-170-find-the-largest-0-to-9-pandigital-that-can-be-formed-by-concatenating-products.english.md index d85f4d6e67..9eb94e2a2d 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-170-find-the-largest-0-to-9-pandigital-that-can-be-formed-by-concatenating-products.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-170-find-the-largest-0-to-9-pandigital-that-can-be-formed-by-concatenating-products.english.md @@ -29,7 +29,7 @@ What is the largest 0 to 9 pandigital 10-digit concatenated product of an intege ```yml tests: - text: euler170() should return 9857164023. - testString: 'assert.strictEqual(euler170(), 9857164023, ''euler170() should return 9857164023.'');' + testString: 'assert.strictEqual(euler170(), 9857164023, "euler170() should return 9857164023.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-171-finding-numbers-for-which-the-sum-of-the-squares-of-the-digits-is-a-square.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-171-finding-numbers-for-which-the-sum-of-the-squares-of-the-digits-is-a-square.english.md index 68c564576c..a372624d2c 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-171-finding-numbers-for-which-the-sum-of-the-squares-of-the-digits-is-a-square.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-171-finding-numbers-for-which-the-sum-of-the-squares-of-the-digits-is-a-square.english.md @@ -24,7 +24,7 @@ Find the last nine digits of the sum of all n, 0 < n < 1020, such that f(n) is a ```yml tests: - text: euler171() should return 142989277. - testString: 'assert.strictEqual(euler171(), 142989277, ''euler171() should return 142989277.'');' + testString: 'assert.strictEqual(euler171(), 142989277, "euler171() should return 142989277.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-172-investigating-numbers-with-few-repeated-digits.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-172-investigating-numbers-with-few-repeated-digits.english.md index cbf24de3e6..3fe21a22ef 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-172-investigating-numbers-with-few-repeated-digits.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-172-investigating-numbers-with-few-repeated-digits.english.md @@ -20,7 +20,7 @@ How many 18-digit numbers n (without leading zeros) are there such that no digit ```yml tests: - text: euler172() should return 227485267000992000. - testString: 'assert.strictEqual(euler172(), 227485267000992000, ''euler172() should return 227485267000992000.'');' + testString: 'assert.strictEqual(euler172(), 227485267000992000, "euler172() should return 227485267000992000.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-173-using-up-to-one-million-tiles-how-many-different-hollow-square-laminae-can-be-formed.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-173-using-up-to-one-million-tiles-how-many-different-hollow-square-laminae-can-be-formed.english.md index ca49df095d..11e22ef769 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-173-using-up-to-one-million-tiles-how-many-different-hollow-square-laminae-can-be-formed.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-173-using-up-to-one-million-tiles-how-many-different-hollow-square-laminae-can-be-formed.english.md @@ -24,7 +24,7 @@ Using up to one million tiles how many different square laminae can be formed? ```yml tests: - text: euler173() should return 1572729. - testString: 'assert.strictEqual(euler173(), 1572729, ''euler173() should return 1572729.'');' + testString: 'assert.strictEqual(euler173(), 1572729, "euler173() should return 1572729.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-174-counting-the-number-of-hollow-square-laminae-that-can-form-one-two-three-...-distinct-arrangements.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-174-counting-the-number-of-hollow-square-laminae-that-can-form-one-two-three-...-distinct-arrangements.english.md index 57952f6214..5ef8aabac0 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-174-counting-the-number-of-hollow-square-laminae-that-can-form-one-two-three-...-distinct-arrangements.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-174-counting-the-number-of-hollow-square-laminae-that-can-form-one-two-three-...-distinct-arrangements.english.md @@ -26,7 +26,7 @@ What is ∑ N(n) for 1 ≤ n ≤ 10? ```yml tests: - text: euler174() should return 209566. - testString: 'assert.strictEqual(euler174(), 209566, ''euler174() should return 209566.'');' + testString: 'assert.strictEqual(euler174(), 209566, "euler174() should return 209566.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-175-fractions-involving-the-number-of-different-ways-a-number-can-be-expressed-as-a-sum-of-powers-of-2.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-175-fractions-involving-the-number-of-different-ways-a-number-can-be-expressed-as-a-sum-of-powers-of-2.english.md index 1bc83c57ad..c21d2e5eba 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-175-fractions-involving-the-number-of-different-ways-a-number-can-be-expressed-as-a-sum-of-powers-of-2.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-175-fractions-involving-the-number-of-different-ways-a-number-can-be-expressed-as-a-sum-of-powers-of-2.english.md @@ -6,7 +6,7 @@ title: 'Problem 175: Fractions involving the number of different ways a number c ## Description
-Define f(0)=1 and f(n) to be the number of ways to write n as a sum of powers of 2 where no power occurs more than twice. +Define f(0)=1 and f(n) to be the number of ways to write n as a sum of powers of 2 where no power occurs more than twice. For example, f(10)=5 since there are five different ways to express 10:10 = 8+2 = 8+1+1 = 4+4+2 = 4+2+2+1+1 = 4+4+1+1 @@ -29,7 +29,7 @@ Give your answer as comma separated integers, without any whitespaces. ```yml tests: - text: 'euler175() should return 1, 13717420, 8.' - testString: 'assert.strictEqual(euler175(), 1, 13717420, 8, ''euler175() should return 1, 13717420, 8.'');' + testString: 'assert.strictEqual(euler175(), 1, 13717420, 8, "euler175() should return 1, 13717420, 8.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-176-right-angled-triangles-that-share-a-cathetus.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-176-right-angled-triangles-that-share-a-cathetus.english.md index 73dc81625b..1756882f8d 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-176-right-angled-triangles-that-share-a-cathetus.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-176-right-angled-triangles-that-share-a-cathetus.english.md @@ -21,7 +21,7 @@ Find the smallest integer that can be the length of a cathetus of exactly 47547 ```yml tests: - text: euler176() should return 96818198400000. - testString: 'assert.strictEqual(euler176(), 96818198400000, ''euler176() should return 96818198400000.'');' + testString: 'assert.strictEqual(euler176(), 96818198400000, "euler176() should return 96818198400000.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-177-integer-angled-quadrilaterals.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-177-integer-angled-quadrilaterals.english.md index 8e7c096012..e014960b63 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-177-integer-angled-quadrilaterals.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-177-integer-angled-quadrilaterals.english.md @@ -25,7 +25,7 @@ Note: In your calculations you may assume that a calculated angle is integral if ```yml tests: - text: euler177() should return 129325. - testString: 'assert.strictEqual(euler177(), 129325, ''euler177() should return 129325.'');' + testString: 'assert.strictEqual(euler177(), 129325, "euler177() should return 129325.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-178-step-numbers.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-178-step-numbers.english.md index df1353c93c..4f4d61f2ee 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-178-step-numbers.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-178-step-numbers.english.md @@ -6,7 +6,7 @@ title: 'Problem 178: Step Numbers' ## Description
-Consider the number 45656. +Consider the number 45656. It can be seen that each pair of consecutive digits of 45656 has a difference of one. A number for which every pair of consecutive digits has a difference of one is called a step number. A pandigital number contains every decimal digit from 0 to 9 at least once. @@ -25,7 +25,7 @@ How many pandigital step numbers less than 1040 are there? ```yml tests: - text: euler178() should return 126461847755. - testString: 'assert.strictEqual(euler178(), 126461847755, ''euler178() should return 126461847755.'');' + testString: 'assert.strictEqual(euler178(), 126461847755, "euler178() should return 126461847755.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-179-consecutive-positive-divisors.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-179-consecutive-positive-divisors.english.md index d64a070519..2d58311ab4 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-179-consecutive-positive-divisors.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-179-consecutive-positive-divisors.english.md @@ -20,7 +20,7 @@ Find the number of integers 1 < n < 107, for which n and n + 1 have the same num ```yml tests: - text: euler179() should return 986262. - testString: 'assert.strictEqual(euler179(), 986262, ''euler179() should return 986262.'');' + testString: 'assert.strictEqual(euler179(), 986262, "euler179() should return 986262.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-18-maximum-path-sum-i.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-18-maximum-path-sum-i.english.md index 0596df9990..b3ffd67a40 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-18-maximum-path-sum-i.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-18-maximum-path-sum-i.english.md @@ -25,9 +25,9 @@ Find the maximum total from top to bottom of the triangle below: ```yml tests: - text: maximumPathSumI(testTriangle) should return 23. - testString: 'assert.strictEqual(maximumPathSumI(testTriangle), 23, ''maximumPathSumI(testTriangle) should return 23.'');' + testString: 'assert.strictEqual(maximumPathSumI(testTriangle), 23, "maximumPathSumI(testTriangle) should return 23.");' - text: maximumPathSumI(numTriangle) should return 1074. - testString: 'assert.strictEqual(maximumPathSumI(numTriangle), 1074, ''maximumPathSumI(numTriangle) should return 1074.'');' + testString: 'assert.strictEqual(maximumPathSumI(numTriangle), 1074, "maximumPathSumI(numTriangle) should return 1074.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-180-rational-zeros-of-a-function-of-three-variables.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-180-rational-zeros-of-a-function-of-three-variables.english.md index a3b970ab53..00be8a76a5 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-180-rational-zeros-of-a-function-of-three-variables.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-180-rational-zeros-of-a-function-of-three-variables.english.md @@ -28,7 +28,7 @@ Find u + v. ```yml tests: - text: euler180() should return 285196020571078980. - testString: 'assert.strictEqual(euler180(), 285196020571078980, ''euler180() should return 285196020571078980.'');' + testString: 'assert.strictEqual(euler180(), 285196020571078980, "euler180() should return 285196020571078980.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-181-investigating-in-how-many-ways-objects-of-two-different-colours-can-be-grouped.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-181-investigating-in-how-many-ways-objects-of-two-different-colours-can-be-grouped.english.md index b283aedaf6..6ba48f1664 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-181-investigating-in-how-many-ways-objects-of-two-different-colours-can-be-grouped.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-181-investigating-in-how-many-ways-objects-of-two-different-colours-can-be-grouped.english.md @@ -23,7 +23,7 @@ In how many ways can sixty black objects B and forty white objects W be thus gr ```yml tests: - text: euler181() should return 83735848679360670. - testString: 'assert.strictEqual(euler181(), 83735848679360670, ''euler181() should return 83735848679360670.'');' + testString: 'assert.strictEqual(euler181(), 83735848679360670, "euler181() should return 83735848679360670.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-182-rsa-encryption.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-182-rsa-encryption.english.md index d19183089a..b2cbff9b09 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-182-rsa-encryption.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-182-rsa-encryption.english.md @@ -34,7 +34,7 @@ Find the sum of all values of e, 1euler182() should return 399788195976. - testString: 'assert.strictEqual(euler182(), 399788195976, ''euler182() should return 399788195976.'');' + testString: 'assert.strictEqual(euler182(), 399788195976, "euler182() should return 399788195976.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-183-maximum-product-of-parts.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-183-maximum-product-of-parts.english.md index e57c7c603c..be633ccb4e 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-183-maximum-product-of-parts.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-183-maximum-product-of-parts.english.md @@ -35,7 +35,7 @@ Find ΣD(N) for 5 ≤ N ≤ 10000. ```yml tests: - text: euler183() should return 48861552. - testString: 'assert.strictEqual(euler183(), 48861552, ''euler183() should return 48861552.'');' + testString: 'assert.strictEqual(euler183(), 48861552, "euler183() should return 48861552.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-184-triangles-containing-the-origin.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-184-triangles-containing-the-origin.english.md index d4f2a2d4b7..3623fe39a0 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-184-triangles-containing-the-origin.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-184-triangles-containing-the-origin.english.md @@ -26,7 +26,7 @@ How many triangles are there containing the origin in the interior and having al ```yml tests: - text: euler184() should return 1725323624056. - testString: 'assert.strictEqual(euler184(), 1725323624056, ''euler184() should return 1725323624056.'');' + testString: 'assert.strictEqual(euler184(), 1725323624056, "euler184() should return 1725323624056.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-185-number-mind.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-185-number-mind.english.md index cb413d9b08..7ffc19ee77 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-185-number-mind.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-185-number-mind.english.md @@ -57,7 +57,7 @@ Find the unique 16-digit secret sequence. ```yml tests: - text: euler185() should return 4640261571849533. - testString: 'assert.strictEqual(euler185(), 4640261571849533, ''euler185() should return 4640261571849533.'');' + testString: 'assert.strictEqual(euler185(), 4640261571849533, "euler185() should return 4640261571849533.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-186-connectedness-of-a-network.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-186-connectedness-of-a-network.english.md index da807c83cc..ef10979688 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-186-connectedness-of-a-network.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-186-connectedness-of-a-network.english.md @@ -32,7 +32,7 @@ The Prime Minister's phone number is 524287. After how many successful calls, no ```yml tests: - text: euler186() should return 2325629. - testString: 'assert.strictEqual(euler186(), 2325629, ''euler186() should return 2325629.'');' + testString: 'assert.strictEqual(euler186(), 2325629, "euler186() should return 2325629.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-187-semiprimes.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-187-semiprimes.english.md index d9882b34cf..a683a03321 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-187-semiprimes.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-187-semiprimes.english.md @@ -25,7 +25,7 @@ How many composite integers, n < 108, have precisely two, not necessarily distin ```yml tests: - text: euler187() should return 17427258. - testString: 'assert.strictEqual(euler187(), 17427258, ''euler187() should return 17427258.'');' + testString: 'assert.strictEqual(euler187(), 17427258, "euler187() should return 17427258.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-188-the-hyperexponentiation-of-a-number.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-188-the-hyperexponentiation-of-a-number.english.md index fcc15f83ff..644a667564 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-188-the-hyperexponentiation-of-a-number.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-188-the-hyperexponentiation-of-a-number.english.md @@ -25,7 +25,7 @@ Find the last 8 digits of 1777↑↑1855. ```yml tests: - text: euler188() should return 95962097. - testString: 'assert.strictEqual(euler188(), 95962097, ''euler188() should return 95962097.'');' + testString: 'assert.strictEqual(euler188(), 95962097, "euler188() should return 95962097.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-189-tri-colouring-a-triangular-grid.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-189-tri-colouring-a-triangular-grid.english.md index e4332dd220..bd583f5544 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-189-tri-colouring-a-triangular-grid.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-189-tri-colouring-a-triangular-grid.english.md @@ -11,7 +11,7 @@ Consider the following configuration of 64 triangles: We wish to colour the interior of each triangle with one of three colours: red, green or blue, so that no two neighbouring triangles have the same colour. Such a colouring shall be called valid. Here, two triangles are said to be neighbouring if they share an edge. -Note: if they only share a vertex, then they are not neighbours. +Note: if they only share a vertex, then they are not neighbours. For example, here is a valid colouring of the above grid: @@ -32,7 +32,7 @@ How many distinct valid colourings are there for the above configuration? ```yml tests: - text: euler189() should return 10834893628237824. - testString: 'assert.strictEqual(euler189(), 10834893628237824, ''euler189() should return 10834893628237824.'');' + testString: 'assert.strictEqual(euler189(), 10834893628237824, "euler189() should return 10834893628237824.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-19-counting-sundays.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-19-counting-sundays.english.md index 6ba6b657db..16298c1156 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-19-counting-sundays.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-19-counting-sundays.english.md @@ -22,11 +22,11 @@ How many Sundays fell on the first of the month during the twentieth century (1 ```yml tests: - text: 'countingSundays(1943, 1946) should return 6.' - testString: 'assert.strictEqual(countingSundays(1943, 1946), 6, ''countingSundays(1943, 1946) should return 6.'');' + testString: 'assert.strictEqual(countingSundays(1943, 1946), 6, "countingSundays(1943, 1946) should return 6.");' - text: 'countingSundays(1995, 2000) should return 9.' - testString: 'assert.strictEqual(countingSundays(1995, 2000), 9, ''countingSundays(1995, 2000) should return 9.'');' + testString: 'assert.strictEqual(countingSundays(1995, 2000), 9, "countingSundays(1995, 2000) should return 9.");' - text: 'countingSundays(1901, 2000) should return 171.' - testString: 'assert.strictEqual(countingSundays(1901, 2000), 171, ''countingSundays(1901, 2000) should return 171.'');' + testString: 'assert.strictEqual(countingSundays(1901, 2000), 171, "countingSundays(1901, 2000) should return 171.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-190-maximising-a-weighted-product.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-190-maximising-a-weighted-product.english.md index 7faf7476a5..91c3c98b7b 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-190-maximising-a-weighted-product.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-190-maximising-a-weighted-product.english.md @@ -24,7 +24,7 @@ Find Σ[Pm] for 2 ≤ m ≤ 15. ```yml tests: - text: euler190() should return 371048281. - testString: 'assert.strictEqual(euler190(), 371048281, ''euler190() should return 371048281.'');' + testString: 'assert.strictEqual(euler190(), 371048281, "euler190() should return 371048281.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-191-prize-strings.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-191-prize-strings.english.md index 2cff1256c6..4c6ac01947 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-191-prize-strings.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-191-prize-strings.english.md @@ -32,7 +32,7 @@ How many "prize" strings exist over a 30-day period? ```yml tests: - text: euler191() should return 1918080160. - testString: 'assert.strictEqual(euler191(), 1918080160, ''euler191() should return 1918080160.'');' + testString: 'assert.strictEqual(euler191(), 1918080160, "euler191() should return 1918080160.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-192-best-approximations.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-192-best-approximations.english.md index 35646198e7..867eb9d491 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-192-best-approximations.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-192-best-approximations.english.md @@ -27,7 +27,7 @@ Find the sum of all denominators of the best approximations to √n for the deno ```yml tests: - text: euler192() should return 57060635927998344. - testString: 'assert.strictEqual(euler192(), 57060635927998344, ''euler192() should return 57060635927998344.'');' + testString: 'assert.strictEqual(euler192(), 57060635927998344, "euler192() should return 57060635927998344.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-193-squarefree-numbers.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-193-squarefree-numbers.english.md index f1b6dea095..d1a2097b78 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-193-squarefree-numbers.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-193-squarefree-numbers.english.md @@ -22,7 +22,7 @@ How many squarefree numbers are there below 250? ```yml tests: - text: euler193() should return 684465067343069. - testString: 'assert.strictEqual(euler193(), 684465067343069, ''euler193() should return 684465067343069.'');' + testString: 'assert.strictEqual(euler193(), 684465067343069, "euler193() should return 684465067343069.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-194-coloured-configurations.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-194-coloured-configurations.english.md index d2fbde742d..72d447ab4c 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-194-coloured-configurations.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-194-coloured-configurations.english.md @@ -6,7 +6,7 @@ title: 'Problem 194: Coloured Configurations' ## Description
-Consider graphs built with the units A: +Consider graphs built with the units A: and B: , where the units are glued along the vertical edges as in the graph . @@ -30,7 +30,7 @@ Find the last 8 digits of N(25,75,1984). ```yml tests: - text: euler194() should return 61190912. - testString: 'assert.strictEqual(euler194(), 61190912, ''euler194() should return 61190912.'');' + testString: 'assert.strictEqual(euler194(), 61190912, "euler194() should return 61190912.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-195-inscribed-circles-of-triangles-with-one-angle-of-60-degrees.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-195-inscribed-circles-of-triangles-with-one-angle-of-60-degrees.english.md index ae618a6f4e..c424438801 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-195-inscribed-circles-of-triangles-with-one-angle-of-60-degrees.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-195-inscribed-circles-of-triangles-with-one-angle-of-60-degrees.english.md @@ -26,7 +26,7 @@ Find T(1053779). ```yml tests: - text: euler195() should return 75085391. - testString: 'assert.strictEqual(euler195(), 75085391, ''euler195() should return 75085391.'');' + testString: 'assert.strictEqual(euler195(), 75085391, "euler195() should return 75085391.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-196-prime-triplets.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-196-prime-triplets.english.md index ea290c28a9..75816b247b 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-196-prime-triplets.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-196-prime-triplets.english.md @@ -46,7 +46,7 @@ Find  S(5678027) + S(7208785). ```yml tests: - text: euler196() should return 322303240771079940. - testString: 'assert.strictEqual(euler196(), 322303240771079940, ''euler196() should return 322303240771079940.'');' + testString: 'assert.strictEqual(euler196(), 322303240771079940, "euler196() should return 322303240771079940.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-197-investigating-the-behaviour-of-a-recursively-defined-sequence.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-197-investigating-the-behaviour-of-a-recursively-defined-sequence.english.md index 195612a7da..54c5359f28 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-197-investigating-the-behaviour-of-a-recursively-defined-sequence.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-197-investigating-the-behaviour-of-a-recursively-defined-sequence.english.md @@ -24,7 +24,7 @@ Give your answer with 9 digits after the decimal point. ```yml tests: - text: euler197() should return 1.710637717. - testString: 'assert.strictEqual(euler197(), 1.710637717, ''euler197() should return 1.710637717.'');' + testString: 'assert.strictEqual(euler197(), 1.710637717, "euler197() should return 1.710637717.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-198-ambiguous-numbers.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-198-ambiguous-numbers.english.md index 78d5c61cf0..79f79926f6 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-198-ambiguous-numbers.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-198-ambiguous-numbers.english.md @@ -26,7 +26,7 @@ How many ambiguous numbers x = p/q, ```yml tests: - text: euler198() should return 52374425. - testString: 'assert.strictEqual(euler198(), 52374425, ''euler198() should return 52374425.'');' + testString: 'assert.strictEqual(euler198(), 52374425, "euler198() should return 52374425.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-199-iterative-circle-packing.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-199-iterative-circle-packing.english.md index 179616b6f9..3aa1a2a3a4 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-199-iterative-circle-packing.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-199-iterative-circle-packing.english.md @@ -28,7 +28,7 @@ Give your answer rounded to eight decimal places using the format x.xxxxxxxx . ```yml tests: - text: euler199() should return 0.00396087. - testString: 'assert.strictEqual(euler199(), 0.00396087, ''euler199() should return 0.00396087.'');' + testString: 'assert.strictEqual(euler199(), 0.00396087, "euler199() should return 0.00396087.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-2-even-fibonacci-numbers.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-2-even-fibonacci-numbers.english.md index 5f6686498f..0bcecde951 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-2-even-fibonacci-numbers.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-2-even-fibonacci-numbers.english.md @@ -22,15 +22,15 @@ By considering the terms in the Fibonacci sequence whose values do not exceed fiboEvenSum(10) should return 188. - testString: 'assert.strictEqual(fiboEvenSum(10), 188, ''fiboEvenSum(10) should return 188.'');' + testString: 'assert.strictEqual(fiboEvenSum(10), 188, "fiboEvenSum(10) should return 188.");' - text: fiboEvenSum(23) should return 60696. - testString: 'assert.strictEqual(fiboEvenSum(23), 60696, ''fiboEvenSum(23) should return 60696.'');' + testString: 'assert.strictEqual(fiboEvenSum(23), 60696, "fiboEvenSum(23) should return 60696.");' - text: fiboEvenSum(43) should return 1485607536. - testString: 'assert.strictEqual(fiboEvenSum(43), 1485607536, ''fiboEvenSum(43) should return 1485607536.'');' + testString: 'assert.strictEqual(fiboEvenSum(43), 1485607536, "fiboEvenSum(43) should return 1485607536.");' - text: Your function is not returning the correct result using our tests values. - testString: 'assert.strictEqual(fiboEvenSum(18), 3382, ''Your function is not returning the correct result using our tests values.'');' + testString: 'assert.strictEqual(fiboEvenSum(18), 3382, "Your function is not returning the correct result using our tests values.");' - text: Your function should return an even value. - testString: 'assert.equal(fiboEvenSum(31) % 2 === 0, true, ''Your function should return an even value.'');' + testString: 'assert.equal(fiboEvenSum(31) % 2 === 0, true, "Your function should return an even value.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-20-factorial-digit-sum.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-20-factorial-digit-sum.english.md index e55c2721fc..8402a6014e 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-20-factorial-digit-sum.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-20-factorial-digit-sum.english.md @@ -22,15 +22,15 @@ Find the sum of the digits n! ```yml tests: - text: sumFactorialDigits(10) should return 27. - testString: 'assert.strictEqual(sumFactorialDigits(10), 27, ''sumFactorialDigits(10) should return 27.'');' + testString: 'assert.strictEqual(sumFactorialDigits(10), 27, "sumFactorialDigits(10) should return 27.");' - text: sumFactorialDigits(25) should return 72. - testString: 'assert.strictEqual(sumFactorialDigits(25), 72, ''sumFactorialDigits(25) should return 72.'');' + testString: 'assert.strictEqual(sumFactorialDigits(25), 72, "sumFactorialDigits(25) should return 72.");' - text: sumFactorialDigits(50) should return 216. - testString: 'assert.strictEqual(sumFactorialDigits(50), 216, ''sumFactorialDigits(50) should return 216.'');' + testString: 'assert.strictEqual(sumFactorialDigits(50), 216, "sumFactorialDigits(50) should return 216.");' - text: sumFactorialDigits(75) should return 432. - testString: 'assert.strictEqual(sumFactorialDigits(75), 432, ''sumFactorialDigits(75) should return 432.'');' + testString: 'assert.strictEqual(sumFactorialDigits(75), 432, "sumFactorialDigits(75) should return 432.");' - text: sumFactorialDigits(100) should return 648. - testString: 'assert.strictEqual(sumFactorialDigits(100), 648, ''sumFactorialDigits(100) should return 648.'');' + testString: 'assert.strictEqual(sumFactorialDigits(100), 648, "sumFactorialDigits(100) should return 648.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-200-find-the-200th-prime-proof-sqube-containing-the-contiguous-sub-string-200.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-200-find-the-200th-prime-proof-sqube-containing-the-contiguous-sub-string-200.english.md index 2444bed6e2..dfe64c3688 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-200-find-the-200th-prime-proof-sqube-containing-the-contiguous-sub-string-200.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-200-find-the-200th-prime-proof-sqube-containing-the-contiguous-sub-string-200.english.md @@ -27,7 +27,7 @@ Find the 200th prime-proof sqube containing the contiguous sub-string "200". ```yml tests: - text: euler200() should return 229161792008. - testString: 'assert.strictEqual(euler200(), 229161792008, ''euler200() should return 229161792008.'');' + testString: 'assert.strictEqual(euler200(), 229161792008, "euler200() should return 229161792008.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-201-subsets-with-a-unique-sum.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-201-subsets-with-a-unique-sum.english.md index 09465df719..038a48f76e 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-201-subsets-with-a-unique-sum.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-201-subsets-with-a-unique-sum.english.md @@ -51,7 +51,7 @@ Determine the sum of all integers which are the sum of exactly one of the 50-ele ```yml tests: - text: euler201() should return 115039000. - testString: 'assert.strictEqual(euler201(), 115039000, ''euler201() should return 115039000.'');' + testString: 'assert.strictEqual(euler201(), 115039000, "euler201() should return 115039000.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-202-laserbeam.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-202-laserbeam.english.md index 11a630094a..af745f93c4 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-202-laserbeam.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-202-laserbeam.english.md @@ -29,7 +29,7 @@ In how many ways can a laser beam enter at vertex C, bounce off 12017639147 surf ```yml tests: - text: euler202() should return 1209002624. - testString: 'assert.strictEqual(euler202(), 1209002624, ''euler202() should return 1209002624.'');' + testString: 'assert.strictEqual(euler202(), 1209002624, "euler202() should return 1209002624.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-203-squarefree-binomial-coefficients.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-203-squarefree-binomial-coefficients.english.md index f3b06da2e4..1782a86ea9 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-203-squarefree-binomial-coefficients.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-203-squarefree-binomial-coefficients.english.md @@ -33,7 +33,7 @@ Find the sum of the distinct squarefree numbers in the first 51 rows of Pascal's ```yml tests: - text: euler203() should return 34029210557338. - testString: 'assert.strictEqual(euler203(), 34029210557338, ''euler203() should return 34029210557338.'');' + testString: 'assert.strictEqual(euler203(), 34029210557338, "euler203() should return 34029210557338.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-204-generalised-hamming-numbers.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-204-generalised-hamming-numbers.english.md index 0f40e0406e..6339b12651 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-204-generalised-hamming-numbers.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-204-generalised-hamming-numbers.english.md @@ -27,7 +27,7 @@ How many generalised Hamming numbers of type 100 are there which don't exceed 10 ```yml tests: - text: euler204() should return 2944730. - testString: 'assert.strictEqual(euler204(), 2944730, ''euler204() should return 2944730.'');' + testString: 'assert.strictEqual(euler204(), 2944730, "euler204() should return 2944730.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-205-dice-game.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-205-dice-game.english.md index d43ec994b5..b5b847e655 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-205-dice-game.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-205-dice-game.english.md @@ -25,7 +25,7 @@ What is the probability that Pyramidal Pete beats Cubic Colin? Give your answer ```yml tests: - text: euler205() should return 0.5731441. - testString: 'assert.strictEqual(euler205(), 0.5731441, ''euler205() should return 0.5731441.'');' + testString: 'assert.strictEqual(euler205(), 0.5731441, "euler205() should return 0.5731441.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-206-concealed-square.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-206-concealed-square.english.md index 056685aac2..eddaa08f03 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-206-concealed-square.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-206-concealed-square.english.md @@ -20,7 +20,7 @@ Find the unique positive integer whose square has the form 1_2_3_4_5_6_7_8_9_0, ```yml tests: - text: euler206() should return 1389019170. - testString: 'assert.strictEqual(euler206(), 1389019170, ''euler206() should return 1389019170.'');' + testString: 'assert.strictEqual(euler206(), 1389019170, "euler206() should return 1389019170.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-207-integer-partition-equations.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-207-integer-partition-equations.english.md index c8dd9b4b10..50ab6e66c2 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-207-integer-partition-equations.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-207-integer-partition-equations.english.md @@ -11,7 +11,7 @@ where 4t, 2t, and k are all positive integers and t is a real number. The first two such partitions are 41 = 21 + 2 and 41.5849625... = 21.5849625... + 6. -Partitions where t is also an integer are called perfect. +Partitions where t is also an integer are called perfect. For any m ≥ 1 let P(m) be the proportion of such partitions that are perfect with k ≤ m. Thus P(6) = 1/2. @@ -41,7 +41,7 @@ Find the smallest m for which P(m) < 1/12345 ```yml tests: - text: euler207() should return 44043947822. - testString: 'assert.strictEqual(euler207(), 44043947822, ''euler207() should return 44043947822.'');' + testString: 'assert.strictEqual(euler207(), 44043947822, "euler207() should return 44043947822.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-208-robot-walks.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-208-robot-walks.english.md index 021b03ad50..e8365dc525 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-208-robot-walks.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-208-robot-walks.english.md @@ -27,7 +27,7 @@ Given that the robot starts facing North, how many journeys of 70 arcs in length ```yml tests: - text: euler208() should return 331951449665644800. - testString: 'assert.strictEqual(euler208(), 331951449665644800, ''euler208() should return 331951449665644800.'');' + testString: 'assert.strictEqual(euler208(), 331951449665644800, "euler208() should return 331951449665644800.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-209-circular-logic.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-209-circular-logic.english.md index 943a8c9bc2..dedafd8d85 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-209-circular-logic.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-209-circular-logic.english.md @@ -30,7 +30,7 @@ for all 6-bit inputs (a, b, c, d, e, f)? ```yml tests: - text: euler209() should return 15964587728784. - testString: 'assert.strictEqual(euler209(), 15964587728784, ''euler209() should return 15964587728784.'');' + testString: 'assert.strictEqual(euler209(), 15964587728784, "euler209() should return 15964587728784.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-21-amicable-numbers.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-21-amicable-numbers.english.md index 719df2b2e3..2fa16e99f0 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-21-amicable-numbers.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-21-amicable-numbers.english.md @@ -23,13 +23,13 @@ Evaluate the sum of all the amicable numbers under n. ```yml tests: - text: sumAmicableNum(1000) should return 504. - testString: 'assert.strictEqual(sumAmicableNum(1000), 504, ''sumAmicableNum(1000) should return 504.'');' + testString: 'assert.strictEqual(sumAmicableNum(1000), 504, "sumAmicableNum(1000) should return 504.");' - text: sumAmicableNum(2000) should return 2898. - testString: 'assert.strictEqual(sumAmicableNum(2000), 2898, ''sumAmicableNum(2000) should return 2898.'');' + testString: 'assert.strictEqual(sumAmicableNum(2000), 2898, "sumAmicableNum(2000) should return 2898.");' - text: sumAmicableNum(5000) should return 8442. - testString: 'assert.strictEqual(sumAmicableNum(5000), 8442, ''sumAmicableNum(5000) should return 8442.'');' + testString: 'assert.strictEqual(sumAmicableNum(5000), 8442, "sumAmicableNum(5000) should return 8442.");' - text: sumAmicableNum(10000) should return 31626. - testString: 'assert.strictEqual(sumAmicableNum(10000), 31626, ''sumAmicableNum(10000) should return 31626.'');' + testString: 'assert.strictEqual(sumAmicableNum(10000), 31626, "sumAmicableNum(10000) should return 31626.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-210-obtuse-angled-triangles.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-210-obtuse-angled-triangles.english.md index 03e468d702..d09b42ae3e 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-210-obtuse-angled-triangles.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-210-obtuse-angled-triangles.english.md @@ -6,8 +6,8 @@ title: 'Problem 210: Obtuse Angled Triangles' ## Description
-Consider the set S(r) of points (x,y) with integer coordinates satisfying |x| + |y| ≤ r. -Let O be the point (0,0) and C the point (r/4,r/4). +Consider the set S(r) of points (x,y) with integer coordinates satisfying |x| + |y| ≤ r. +Let O be the point (0,0) and C the point (r/4,r/4). Let N(r) be the number of points B in S(r), so that the triangle OBC has an obtuse angle, i.e. the largest angle α satisfies 90°<α<180°. So, for example, N(4)=24 and N(8)=100. @@ -25,7 +25,7 @@ What is N(1,000,000,000)? ```yml tests: - text: euler210() should return 1598174770174689500. - testString: 'assert.strictEqual(euler210(), 1598174770174689500, ''euler210() should return 1598174770174689500.'');' + testString: 'assert.strictEqual(euler210(), 1598174770174689500, "euler210() should return 1598174770174689500.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-211-divisor-square-sum.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-211-divisor-square-sum.english.md index 36ba3a73a4..884031ef2e 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-211-divisor-square-sum.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-211-divisor-square-sum.english.md @@ -22,7 +22,7 @@ Find the sum of all n, 0 < n < 64,000,000 such that σ2(n) is a perfect square. ```yml tests: - text: euler211() should return 1922364685. - testString: 'assert.strictEqual(euler211(), 1922364685, ''euler211() should return 1922364685.'');' + testString: 'assert.strictEqual(euler211(), 1922364685, "euler211() should return 1922364685.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-212-combined-volume-of-cuboids.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-212-combined-volume-of-cuboids.english.md index 6d4d5d5591..077f83693a 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-212-combined-volume-of-cuboids.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-212-combined-volume-of-cuboids.english.md @@ -34,7 +34,7 @@ What is the combined volume of all 50000 cuboids, C1,...,C50000 ? ```yml tests: - text: euler212() should return 328968937309. - testString: 'assert.strictEqual(euler212(), 328968937309, ''euler212() should return 328968937309.'');' + testString: 'assert.strictEqual(euler212(), 328968937309, "euler212() should return 328968937309.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-213-flea-circus.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-213-flea-circus.english.md index 27da853e68..d38d7ffcd6 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-213-flea-circus.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-213-flea-circus.english.md @@ -23,7 +23,7 @@ What is the expected number of unoccupied squares after 50 rings of the bell? Gi ```yml tests: - text: euler213() should return 330.721154. - testString: 'assert.strictEqual(euler213(), 330.721154, ''euler213() should return 330.721154.'');' + testString: 'assert.strictEqual(euler213(), 330.721154, "euler213() should return 330.721154.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-214-totient-chains.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-214-totient-chains.english.md index 3aa37fbff6..1fbcbb885f 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-214-totient-chains.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-214-totient-chains.english.md @@ -39,7 +39,7 @@ What is the sum of all primes less than 40000000 which generate a chain of lengt ```yml tests: - text: euler214() should return 1677366278943. - testString: 'assert.strictEqual(euler214(), 1677366278943, ''euler214() should return 1677366278943.'');' + testString: 'assert.strictEqual(euler214(), 1677366278943, "euler214() should return 1677366278943.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-215-crack-free-walls.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-215-crack-free-walls.english.md index 10ba30d37f..daeb1fd612 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-215-crack-free-walls.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-215-crack-free-walls.english.md @@ -29,7 +29,7 @@ Calculate W(32,10). ```yml tests: - text: euler215() should return 806844323190414. - testString: 'assert.strictEqual(euler215(), 806844323190414, ''euler215() should return 806844323190414.'');' + testString: 'assert.strictEqual(euler215(), 806844323190414, "euler215() should return 806844323190414.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-216-investigating-the-primality-of-numbers-of-the-form-2n2-1.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-216-investigating-the-primality-of-numbers-of-the-form-2n2-1.english.md index 8ae6808e98..fe99933c6b 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-216-investigating-the-primality-of-numbers-of-the-form-2n2-1.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-216-investigating-the-primality-of-numbers-of-the-form-2n2-1.english.md @@ -25,7 +25,7 @@ How many numbers t(n) are prime for n ≤ 50,000,000 ? ```yml tests: - text: euler216() should return 5437849. - testString: 'assert.strictEqual(euler216(), 5437849, ''euler216() should return 5437849.'');' + testString: 'assert.strictEqual(euler216(), 5437849, "euler216() should return 5437849.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-217-balanced-numbers.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-217-balanced-numbers.english.md index dc67af80a5..27e8ba8ddb 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-217-balanced-numbers.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-217-balanced-numbers.english.md @@ -8,8 +8,8 @@ title: 'Problem 217: Balanced Numbers'
A positive integer with k (decimal) digits is called balanced if its first ⌈k/2⌉ digits sum to the same value as its last ⌈k/2⌉ digits, where ⌈x⌉, pronounced ceiling of x, is the smallest integer ≥ x, thus ⌈π⌉ = 4 and ⌈5⌉ = 5. So, for example, all palindromes are balanced, as is 13722. -Let T(n) be the sum of all balanced numbers less than 10n. -Thus: T(1) = 45, T(2) = 540 and T(5) = 334795890. +Let T(n) be the sum of all balanced numbers less than 10n. +Thus: T(1) = 45, T(2) = 540 and T(5) = 334795890. Find T(47) mod 315
@@ -24,7 +24,7 @@ Find T(47) mod 315 ```yml tests: - text: euler217() should return 6273134. - testString: 'assert.strictEqual(euler217(), 6273134, ''euler217() should return 6273134.'');' + testString: 'assert.strictEqual(euler217(), 6273134, "euler217() should return 6273134.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-218-perfect-right-angled-triangles.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-218-perfect-right-angled-triangles.english.md index 6d9b42d6df..5ac8d4f1c0 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-218-perfect-right-angled-triangles.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-218-perfect-right-angled-triangles.english.md @@ -34,7 +34,7 @@ How many perfect right-angled triangles with c≤1016 exist that are not super-p ```yml tests: - text: euler218() should return 0. - testString: 'assert.strictEqual(euler218(), 0, ''euler218() should return 0.'');' + testString: 'assert.strictEqual(euler218(), 0, "euler218() should return 0.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-219-skew-cost-coding.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-219-skew-cost-coding.english.md index a2a769b149..96f19469e7 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-219-skew-cost-coding.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-219-skew-cost-coding.english.md @@ -32,7 +32,7 @@ What is Cost(109) ? ```yml tests: - text: euler219() should return 64564225042. - testString: 'assert.strictEqual(euler219(), 64564225042, ''euler219() should return 64564225042.'');' + testString: 'assert.strictEqual(euler219(), 64564225042, "euler219() should return 64564225042.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-22-names-scores.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-22-names-scores.english.md index 1303a8cb64..7aec66ea9e 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-22-names-scores.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-22-names-scores.english.md @@ -22,11 +22,11 @@ What is the total of all the name scores in the file? ```yml tests: - text: namesScores(test1) should return 791. - testString: 'assert.strictEqual(namesScores(test1), 791, ''namesScores(test1) should return 791.'');' + testString: 'assert.strictEqual(namesScores(test1), 791, "namesScores(test1) should return 791.");' - text: namesScores(test2) should return 1468. - testString: 'assert.strictEqual(namesScores(test2), 1468, ''namesScores(test2) should return 1468.'');' + testString: 'assert.strictEqual(namesScores(test2), 1468, "namesScores(test2) should return 1468.");' - text: namesScores(names) should return 871198282. - testString: 'assert.strictEqual(namesScores(names), 871198282, ''namesScores(names) should return 871198282.'');' + testString: 'assert.strictEqual(namesScores(names), 871198282, "namesScores(names) should return 871198282.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-220-heighway-dragon.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-220-heighway-dragon.english.md index 5da8d88925..a7f0853ebe 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-220-heighway-dragon.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-220-heighway-dragon.english.md @@ -35,7 +35,7 @@ Give your answer in the form x,y with no spaces. ```yml tests: - text: 'euler220() should return 139776, 963904.' - testString: 'assert.strictEqual(euler220(), 139776, 963904, ''euler220() should return 139776, 963904.'');' + testString: 'assert.strictEqual(euler220(), 139776, 963904, "euler220() should return 139776, 963904.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-221-alexandrian-integers.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-221-alexandrian-integers.english.md index e4510807ab..2a4926fc7b 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-221-alexandrian-integers.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-221-alexandrian-integers.english.md @@ -39,7 +39,7 @@ Find the 150000th Alexandrian integer. ```yml tests: - text: euler221() should return 1884161251122450. - testString: 'assert.strictEqual(euler221(), 1884161251122450, ''euler221() should return 1884161251122450.'');' + testString: 'assert.strictEqual(euler221(), 1884161251122450, "euler221() should return 1884161251122450.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-222-sphere-packing.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-222-sphere-packing.english.md index 7bbeba9113..f5fdf1b4b7 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-222-sphere-packing.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-222-sphere-packing.english.md @@ -22,7 +22,7 @@ Give your answer in micrometres (10-6 m) rounded to the nearest integer. ```yml tests: - text: euler222() should return 1590933. - testString: 'assert.strictEqual(euler222(), 1590933, ''euler222() should return 1590933.'');' + testString: 'assert.strictEqual(euler222(), 1590933, "euler222() should return 1590933.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-223-almost-right-angled-triangles-i.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-223-almost-right-angled-triangles-i.english.md index d7f4e094b4..0b71d4fb5c 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-223-almost-right-angled-triangles-i.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-223-almost-right-angled-triangles-i.english.md @@ -22,7 +22,7 @@ How many barely acute triangles are there with perimeter ≤ 25,000,000? ```yml tests: - text: euler223() should return 61614848. - testString: 'assert.strictEqual(euler223(), 61614848, ''euler223() should return 61614848.'');' + testString: 'assert.strictEqual(euler223(), 61614848, "euler223() should return 61614848.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-224-almost-right-angled-triangles-ii.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-224-almost-right-angled-triangles-ii.english.md index cf5c05cd2f..9de9687fdb 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-224-almost-right-angled-triangles-ii.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-224-almost-right-angled-triangles-ii.english.md @@ -22,7 +22,7 @@ How many barely obtuse triangles are there with perimeter ≤ 75,000,000? ```yml tests: - text: euler224() should return 4137330. - testString: 'assert.strictEqual(euler224(), 4137330, ''euler224() should return 4137330.'');' + testString: 'assert.strictEqual(euler224(), 4137330, "euler224() should return 4137330.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-225-tribonacci-non-divisors.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-225-tribonacci-non-divisors.english.md index 53932e1287..f0c1f73527 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-225-tribonacci-non-divisors.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-225-tribonacci-non-divisors.english.md @@ -26,7 +26,7 @@ Find the 124th odd number that does not divide any terms of the above sequence. ```yml tests: - text: euler225() should return 2009. - testString: 'assert.strictEqual(euler225(), 2009, ''euler225() should return 2009.'');' + testString: 'assert.strictEqual(euler225(), 2009, "euler225() should return 2009.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-226-a-scoop-of-blancmange.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-226-a-scoop-of-blancmange.english.md index bd90333dac..273b4ccf61 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-226-a-scoop-of-blancmange.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-226-a-scoop-of-blancmange.english.md @@ -29,7 +29,7 @@ What area under the blancmange curve is enclosed by C?Give your answer rounded t ```yml tests: - text: euler226() should return 0.11316017. - testString: 'assert.strictEqual(euler226(), 0.11316017, ''euler226() should return 0.11316017.'');' + testString: 'assert.strictEqual(euler226(), 0.11316017, "euler226() should return 0.11316017.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-227-the-chase.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-227-the-chase.english.md index 34a8fc2065..5aacf6a8c7 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-227-the-chase.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-227-the-chase.english.md @@ -27,7 +27,7 @@ Give your answer rounded to ten significant digits. ```yml tests: - text: euler227() should return 3780.618622. - testString: 'assert.strictEqual(euler227(), 3780.618622, ''euler227() should return 3780.618622.'');' + testString: 'assert.strictEqual(euler227(), 3780.618622, "euler227() should return 3780.618622.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-228-minkowski-sums.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-228-minkowski-sums.english.md index de0b7c70ab..10b3a2c982 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-228-minkowski-sums.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-228-minkowski-sums.english.md @@ -6,7 +6,7 @@ title: 'Problem 228: Minkowski Sums' ## Description
-Let Sn be the regular n-sided polygon – or shape – whose vertices +Let Sn be the regular n-sided polygon – or shape – whose vertices vk (k = 1,2,…,n) have coordinates: @@ -17,9 +17,9 @@ vk (k = 1,2,…,n) have coordinates: sin( 2k-1/n ×180° ) Each Sn is to be interpreted as a filled shape consisting of all points on the perimeter and in the interior. -The Minkowski sum, S+T, of two shapes S and T is the result of +The Minkowski sum, S+T, of two shapes S and T is the result of -adding every point in S to every point in T, where point addition is performed coordinate-wise: +adding every point in S to every point in T, where point addition is performed coordinate-wise: (u, v) + (x, y) = (u+x, v+y). @@ -42,7 +42,7 @@ How many sides does S1864 + S1865 + … + S1909 have? ```yml tests: - text: euler228() should return 86226. - testString: 'assert.strictEqual(euler228(), 86226, ''euler228() should return 86226.'');' + testString: 'assert.strictEqual(euler228(), 86226, "euler228() should return 86226.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-229-four-representations-using-squares.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-229-four-representations-using-squares.english.md index 29c48f72aa..9806a06976 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-229-four-representations-using-squares.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-229-four-representations-using-squares.english.md @@ -38,7 +38,7 @@ How many such numbers are there that do not exceed 2×109? ```yml tests: - text: euler229() should return 11325263. - testString: 'assert.strictEqual(euler229(), 11325263, ''euler229() should return 11325263.'');' + testString: 'assert.strictEqual(euler229(), 11325263, "euler229() should return 11325263.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-23-non-abundant-sums.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-23-non-abundant-sums.english.md index af100b0146..48c33c68ff 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-23-non-abundant-sums.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-23-non-abundant-sums.english.md @@ -23,13 +23,13 @@ Find the sum of all positive integers <= n which cannot be written as ```yml tests: - text: sumOfNonAbundantNumbers(10000) should return 3731004. - testString: 'assert(sumOfNonAbundantNumbers(10000) === 3731004, ''sumOfNonAbundantNumbers(10000) should return 3731004.'');' + testString: 'assert(sumOfNonAbundantNumbers(10000) === 3731004, "sumOfNonAbundantNumbers(10000) should return 3731004.");' - text: sumOfNonAbundantNumbers(15000) should return 4039939. - testString: 'assert(sumOfNonAbundantNumbers(15000) === 4039939, ''sumOfNonAbundantNumbers(15000) should return 4039939.'');' + testString: 'assert(sumOfNonAbundantNumbers(15000) === 4039939, "sumOfNonAbundantNumbers(15000) should return 4039939.");' - text: sumOfNonAbundantNumbers(20000) should return 4159710. - testString: 'assert(sumOfNonAbundantNumbers(20000) === 4159710, ''sumOfNonAbundantNumbers(20000) should return 4159710.'');' + testString: 'assert(sumOfNonAbundantNumbers(20000) === 4159710, "sumOfNonAbundantNumbers(20000) should return 4159710.");' - text: sumOfNonAbundantNumbers(28123) should return 4179871. - testString: 'assert(sumOfNonAbundantNumbers(28123) === 4179871, ''sumOfNonAbundantNumbers(28123) should return 4179871.'');' + testString: 'assert(sumOfNonAbundantNumbers(28123) === 4179871, "sumOfNonAbundantNumbers(28123) should return 4179871.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-230-fibonacci-words.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-230-fibonacci-words.english.md index 444be99467..8da8662d47 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-230-fibonacci-words.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-230-fibonacci-words.english.md @@ -24,12 +24,12 @@ The first few terms of FA,B are: Then DA,B(35) is the 35th digit in the fifth term, which is 9. Now we use for A the first 100 digits of π behind the decimal point: -14159265358979323846264338327950288419716939937510 -58209749445923078164062862089986280348253421170679 +14159265358979323846264338327950288419716939937510 +58209749445923078164062862089986280348253421170679 and for B the next hundred digits: -82148086513282306647093844609550582231725359408128 +82148086513282306647093844609550582231725359408128 48111745028410270193852110555964462294895493038196 . Find ∑n = 0,1,...,17   10n× DA,B((127+19n)×7n) . @@ -46,7 +46,7 @@ Find ∑n = 0,1,...,17   10n× DA,B((127+19n)×7n) . ```yml tests: - text: euler230() should return 850481152593119200. - testString: 'assert.strictEqual(euler230(), 850481152593119200, ''euler230() should return 850481152593119200.'');' + testString: 'assert.strictEqual(euler230(), 850481152593119200, "euler230() should return 850481152593119200.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-231-the-prime-factorisation-of-binomial-coefficients.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-231-the-prime-factorisation-of-binomial-coefficients.english.md index 6953636955..b7381e3075 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-231-the-prime-factorisation-of-binomial-coefficients.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-231-the-prime-factorisation-of-binomial-coefficients.english.md @@ -24,7 +24,7 @@ Find the sum of the terms in the prime factorisation of 20000000C15000000. ```yml tests: - text: euler231() should return 7526965179680. - testString: 'assert.strictEqual(euler231(), 7526965179680, ''euler231() should return 7526965179680.'');' + testString: 'assert.strictEqual(euler231(), 7526965179680, "euler231() should return 7526965179680.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-232-the-race.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-232-the-race.english.md index d9b2052d34..2e967083f7 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-232-the-race.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-232-the-race.english.md @@ -26,7 +26,7 @@ Give your answer rounded to eight decimal places in the form 0.abcdefgh . ```yml tests: - text: euler232() should return 0.83648556. - testString: 'assert.strictEqual(euler232(), 0.83648556, ''euler232() should return 0.83648556.'');' + testString: 'assert.strictEqual(euler232(), 0.83648556, "euler232() should return 0.83648556.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-233-lattice-points-on-a-circle.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-233-lattice-points-on-a-circle.english.md index f315d29bc2..92cf46bf9d 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-233-lattice-points-on-a-circle.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-233-lattice-points-on-a-circle.english.md @@ -23,7 +23,7 @@ What is the sum of all positive integers N ≤ 1011 such that f(N) = 420 ```yml tests: - text: euler233() should return 271204031455541300. - testString: 'assert.strictEqual(euler233(), 271204031455541300, ''euler233() should return 271204031455541300.'');' + testString: 'assert.strictEqual(euler233(), 271204031455541300, "euler233() should return 271204031455541300.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-234-semidivisible-numbers.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-234-semidivisible-numbers.english.md index 5fb19d6225..457dbc9599 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-234-semidivisible-numbers.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-234-semidivisible-numbers.english.md @@ -27,7 +27,7 @@ What is the sum of all semidivisible numbers not exceeding 999966663333 ? ```yml tests: - text: euler234() should return 1259187438574927000. - testString: 'assert.strictEqual(euler234(), 1259187438574927000, ''euler234() should return 1259187438574927000.'');' + testString: 'assert.strictEqual(euler234(), 1259187438574927000, "euler234() should return 1259187438574927000.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-235-an-arithmetic-geometric-sequence.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-235-an-arithmetic-geometric-sequence.english.md index daf5ec97a8..3e898d6c3f 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-235-an-arithmetic-geometric-sequence.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-235-an-arithmetic-geometric-sequence.english.md @@ -27,7 +27,7 @@ Give your answer rounded to 12 places behind the decimal point. ```yml tests: - text: euler235() should return 1.002322108633. - testString: 'assert.strictEqual(euler235(), 1.002322108633, ''euler235() should return 1.002322108633.'');' + testString: 'assert.strictEqual(euler235(), 1.002322108633, "euler235() should return 1.002322108633.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-236-luxury-hampers.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-236-luxury-hampers.english.md index 77e8ae2ce9..50f0d10558 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-236-luxury-hampers.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-236-luxury-hampers.english.md @@ -8,7 +8,7 @@ title: 'Problem 236: Luxury Hampers'
Suppliers 'A' and 'B' provided the following numbers of products for the luxury hamper market: -Product'A''B'Beluga Caviar5248640Christmas Cake13121888Gammon Joint26243776Vintage Port57603776Champagne Truffles39365664 +Product'A"B'Beluga Caviar5248640Christmas Cake13121888Gammon Joint26243776Vintage Port57603776Champagne Truffles39365664 Although the suppliers try very hard to ship their goods in perfect condition, there is inevitably some spoilage - i.e. products gone bad. @@ -32,7 +32,7 @@ Give your answer as a fraction reduced to its lowest terms, in the form u/v. ```yml tests: - text: euler236() should return 123 / 59. - testString: 'assert.strictEqual(euler236(), 123 / 59, ''euler236() should return 123 / 59.'');' + testString: 'assert.strictEqual(euler236(), 123 / 59, "euler236() should return 123 / 59.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-237-tours-on-a-4-x-n-playing-board.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-237-tours-on-a-4-x-n-playing-board.english.md index 925de18158..6d6466ec73 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-237-tours-on-a-4-x-n-playing-board.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-237-tours-on-a-4-x-n-playing-board.english.md @@ -30,7 +30,7 @@ T(10) is 2329. What is T(1012) modulo 108? ```yml tests: - text: euler237() should return 15836928. - testString: 'assert.strictEqual(euler237(), 15836928, ''euler237() should return 15836928.'');' + testString: 'assert.strictEqual(euler237(), 15836928, "euler237() should return 15836928.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-238-infinite-string-tour.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-238-infinite-string-tour.english.md index 78f50d0293..52bb5d2d10 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-238-infinite-string-tour.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-238-infinite-string-tour.english.md @@ -23,7 +23,7 @@ For a positive integer k, if no substring of w exists with a sum of digits equal For instance: -The substrings 1, 14, 1402, … +The substrings 1, 14, 1402, … with respective sums of digits equal to 1, 5, 7, … start at position 1, hence p(1) = p(5) = p(7) = … = 1. @@ -53,7 +53,7 @@ Find ∑ p(k), for 0 < k ≤ 2·1015. ```yml tests: - text: euler238() should return 9922545104535660. - testString: 'assert.strictEqual(euler238(), 9922545104535660, ''euler238() should return 9922545104535660.'');' + testString: 'assert.strictEqual(euler238(), 9922545104535660, "euler238() should return 9922545104535660.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-239-twenty-two-foolish-primes.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-239-twenty-two-foolish-primes.english.md index f967fc0345..574d9933ec 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-239-twenty-two-foolish-primes.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-239-twenty-two-foolish-primes.english.md @@ -25,7 +25,7 @@ Give your answer rounded to 12 places behind the decimal point in the form 0.abc ```yml tests: - text: euler239() should return 0.001887854841. - testString: 'assert.strictEqual(euler239(), 0.001887854841, ''euler239() should return 0.001887854841.'');' + testString: 'assert.strictEqual(euler239(), 0.001887854841, "euler239() should return 0.001887854841.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-24-lexicographic-permutations.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-24-lexicographic-permutations.english.md index 2fcc6f36db..abc9089287 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-24-lexicographic-permutations.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-24-lexicographic-permutations.english.md @@ -22,13 +22,13 @@ What is the nth lexicographic permutation of the digits 0, 1, 2, 3, 4 ```yml tests: - text: lexicographicPermutations(699999) should return 1938246570. - testString: 'assert(lexicographicPermutations(699999) == 1938246570, ''lexicographicPermutations(699999) should return 1938246570.'');' + testString: 'assert(lexicographicPermutations(699999) == 1938246570, "lexicographicPermutations(699999) should return 1938246570.");' - text: lexicographicPermutations(899999) should return 2536987410. - testString: 'assert(lexicographicPermutations(899999) == 2536987410, ''lexicographicPermutations(899999) should return 2536987410.'');' + testString: 'assert(lexicographicPermutations(899999) == 2536987410, "lexicographicPermutations(899999) should return 2536987410.");' - text: lexicographicPermutations(900000) should return 2537014689. - testString: 'assert(lexicographicPermutations(900000) == 2537014689, ''lexicographicPermutations(900000) should return 2537014689.'');' + testString: 'assert(lexicographicPermutations(900000) == 2537014689, "lexicographicPermutations(900000) should return 2537014689.");' - text: lexicographicPermutations(999999) should return 2783915460. - testString: 'assert(lexicographicPermutations(999999) == 2783915460, ''lexicographicPermutations(999999) should return 2783915460.'');' + testString: 'assert(lexicographicPermutations(999999) == 2783915460, "lexicographicPermutations(999999) should return 2783915460.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-240-top-dice.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-240-top-dice.english.md index b82ec53adf..069f8c5747 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-240-top-dice.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-240-top-dice.english.md @@ -31,7 +31,7 @@ In how many ways can twenty 12-sided dice (sides numbered 1 to 12) be rolled so ```yml tests: - text: euler240() should return 7448717393364182000. - testString: 'assert.strictEqual(euler240(), 7448717393364182000, ''euler240() should return 7448717393364182000.'');' + testString: 'assert.strictEqual(euler240(), 7448717393364182000, "euler240() should return 7448717393364182000.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-241-perfection-quotients.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-241-perfection-quotients.english.md index ebf297c544..7cb5336f96 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-241-perfection-quotients.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-241-perfection-quotients.english.md @@ -28,7 +28,7 @@ Find the sum of all positive integers n ≤ 1018 for which p(n) has the form k + ```yml tests: - text: euler241() should return 482316491800641150. - testString: 'assert.strictEqual(euler241(), 482316491800641150, ''euler241() should return 482316491800641150.'');' + testString: 'assert.strictEqual(euler241(), 482316491800641150, "euler241() should return 482316491800641150.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-242-odd-triplets.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-242-odd-triplets.english.md index a25bc8f742..62f3a2730e 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-242-odd-triplets.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-242-odd-triplets.english.md @@ -8,7 +8,7 @@ title: 'Problem 242: Odd Triplets'
Given the set {1,2,...,n}, we define f(n,k) as the number of its k-element subsets with an odd sum of elements. For example, f(5,3) = 4, since the set {1,2,3,4,5} has four 3-element subsets having an odd sum of elements, i.e.: {1,2,4}, {1,3,5}, {2,3,4} and {2,4,5}. -When all three values n, k and f(n,k) are odd, we say that they make +When all three values n, k and f(n,k) are odd, we say that they make an odd-triplet [n,k,f(n,k)]. There are exactly five odd-triplets with n ≤ 10, namely: @@ -28,7 +28,7 @@ How many odd-triplets are there with n ≤ 1012 ? ```yml tests: - text: euler242() should return 997104142249036700. - testString: 'assert.strictEqual(euler242(), 997104142249036700, ''euler242() should return 997104142249036700.'');' + testString: 'assert.strictEqual(euler242(), 997104142249036700, "euler242() should return 997104142249036700.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-243-resilience.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-243-resilience.english.md index 1154311aff..c76866e449 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-243-resilience.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-243-resilience.english.md @@ -28,7 +28,7 @@ Find the smallest denominator d, having a resilience R(d) < 15499/94744 . ```yml tests: - text: euler243() should return 892371480. - testString: 'assert.strictEqual(euler243(), 892371480, ''euler243() should return 892371480.'');' + testString: 'assert.strictEqual(euler243(), 892371480, "euler243() should return 892371480.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-244-sliders.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-244-sliders.english.md index 7f084e4476..9a5d68986a 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-244-sliders.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-244-sliders.english.md @@ -45,7 +45,7 @@ What is the sum of all checksums for the paths having the minimal length? ```yml tests: - text: euler244() should return 96356848. - testString: 'assert.strictEqual(euler244(), 96356848, ''euler244() should return 96356848.'');' + testString: 'assert.strictEqual(euler244(), 96356848, "euler244() should return 96356848.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-245-coresilience.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-245-coresilience.english.md index fd0f2717a8..ea44a8256e 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-245-coresilience.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-245-coresilience.english.md @@ -30,7 +30,7 @@ Find the sum of all composite integers 1 < n ≤ 2×1011, for which C(n) is a un ```yml tests: - text: euler245() should return 288084712410001. - testString: 'assert.strictEqual(euler245(), 288084712410001, ''euler245() should return 288084712410001.'');' + testString: 'assert.strictEqual(euler245(), 288084712410001, "euler245() should return 288084712410001.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-246-tangents-to-an-ellipse.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-246-tangents-to-an-ellipse.english.md index 91383ea580..5eef0f6d57 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-246-tangents-to-an-ellipse.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-246-tangents-to-an-ellipse.english.md @@ -15,7 +15,7 @@ The construction of the points of the ellipse is shown below. -Given are the points M(-2000,1500) and G(8000,1500). +Given are the points M(-2000,1500) and G(8000,1500). Given is also the circle c with centre M and radius 15000. The locus of the points that are equidistant from G and c form an ellipse e. From a point P outside e the two tangents t1 and t2 to the ellipse are drawn. @@ -38,7 +38,7 @@ For how many lattice points P is angle RPS greater than 45 degrees? ```yml tests: - text: euler246() should return 810834388. - testString: 'assert.strictEqual(euler246(), 810834388, ''euler246() should return 810834388.'');' + testString: 'assert.strictEqual(euler246(), 810834388, "euler246() should return 810834388.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-247-squares-under-a-hyperbola.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-247-squares-under-a-hyperbola.english.md index 2b6e268fa4..381a08b493 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-247-squares-under-a-hyperbola.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-247-squares-under-a-hyperbola.english.md @@ -9,15 +9,15 @@ title: 'Problem 247: Squares under a hyperbola' Consider the region constrained by 1 ≤ x and 0 ≤ y ≤ 1/x. Let S1 be the largest square that can fit under the curve. -Let S2 be the largest square that fits in the remaining area, and so on. +Let S2 be the largest square that fits in the remaining area, and so on. Let the index of Sn be the pair (left, below) indicating the number of squares to the left of Sn and the number of squares below Sn. -The diagram shows some such squares labelled by number. +The diagram shows some such squares labelled by number. S2 has one square to its left and none below, so the index of S2 is (1,0). -It can be seen that the index of S32 is (1,1) as is the index of S50. +It can be seen that the index of S32 is (1,1) as is the index of S50. 50 is the largest n for which the index of Sn is (1,1). @@ -35,7 +35,7 @@ What is the largest n for which the index of Sn is (3,3)? ```yml tests: - text: euler247() should return 782252. - testString: 'assert.strictEqual(euler247(), 782252, ''euler247() should return 782252.'');' + testString: 'assert.strictEqual(euler247(), 782252, "euler247() should return 782252.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-248-numbers-for-which-eulers-totient-function-equals-13.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-248-numbers-for-which-eulers-totient-function-equals-13.english.md index 45e8c2ebf0..ce1a31843a 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-248-numbers-for-which-eulers-totient-function-equals-13.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-248-numbers-for-which-eulers-totient-function-equals-13.english.md @@ -21,7 +21,7 @@ Find the 150,000th such number. ```yml tests: - text: euler248() should return 23507044290. - testString: 'assert.strictEqual(euler248(), 23507044290, ''euler248() should return 23507044290.'');' + testString: 'assert.strictEqual(euler248(), 23507044290, "euler248() should return 23507044290.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-249-prime-subset-sums.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-249-prime-subset-sums.english.md index 8acff022dd..2e820799c8 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-249-prime-subset-sums.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-249-prime-subset-sums.english.md @@ -22,7 +22,7 @@ Enter the rightmost 16 digits as your answer. ```yml tests: - text: euler249() should return 9275262564250418. - testString: 'assert.strictEqual(euler249(), 9275262564250418, ''euler249() should return 9275262564250418.'');' + testString: 'assert.strictEqual(euler249(), 9275262564250418, "euler249() should return 9275262564250418.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-25-1000-digit-fibonacci-number.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-25-1000-digit-fibonacci-number.english.md index 4fc4225c71..434957ef5b 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-25-1000-digit-fibonacci-number.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-25-1000-digit-fibonacci-number.english.md @@ -25,13 +25,13 @@ What is the index of the first term in the Fibonacci sequence to contain n< ```yml tests: - text: digitFibonacci(5) should return 21. - testString: 'assert.strictEqual(digitFibonacci(5), 21, ''digitFibonacci(5) should return 21.'');' + testString: 'assert.strictEqual(digitFibonacci(5), 21, "digitFibonacci(5) should return 21.");' - text: digitFibonacci(10) should return 45. - testString: 'assert.strictEqual(digitFibonacci(10), 45, ''digitFibonacci(10) should return 45.'');' + testString: 'assert.strictEqual(digitFibonacci(10), 45, "digitFibonacci(10) should return 45.");' - text: digitFibonacci(15) should return 69. - testString: 'assert.strictEqual(digitFibonacci(15), 69, ''digitFibonacci(15) should return 69.'');' + testString: 'assert.strictEqual(digitFibonacci(15), 69, "digitFibonacci(15) should return 69.");' - text: digitFibonacci(20) should return 93. - testString: 'assert.strictEqual(digitFibonacci(20), 93, ''digitFibonacci(20) should return 93.'');' + testString: 'assert.strictEqual(digitFibonacci(20), 93, "digitFibonacci(20) should return 93.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-250-250250.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-250-250250.english.md index 6107230b25..dd9bbf8a0b 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-250-250250.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-250-250250.english.md @@ -20,7 +20,7 @@ Find the number of non-empty subsets of {11, 22, 33,..., 250250250250}, the sum ```yml tests: - text: euler250() should return 1425480602091519. - testString: 'assert.strictEqual(euler250(), 1425480602091519, ''euler250() should return 1425480602091519.'');' + testString: 'assert.strictEqual(euler250(), 1425480602091519, "euler250() should return 1425480602091519.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-251-cardano-triplets.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-251-cardano-triplets.english.md index 447488b52b..775969b002 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-251-cardano-triplets.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-251-cardano-triplets.english.md @@ -30,7 +30,7 @@ Find how many Cardano Triplets exist such that a+b+c ≤ 110,000,000. ```yml tests: - text: euler251() should return 18946051. - testString: 'assert.strictEqual(euler251(), 18946051, ''euler251() should return 18946051.'');' + testString: 'assert.strictEqual(euler251(), 18946051, "euler251() should return 18946051.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-252-convex-holes.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-252-convex-holes.english.md index 909130e3ef..4cf7b52556 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-252-convex-holes.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-252-convex-holes.english.md @@ -6,10 +6,10 @@ title: 'Problem 252: Convex Holes' ## Description
-Given a set of points on a plane, we define a convex hole to be a convex polygon having as vertices any of the given points and not containing any of the given points in its interior (in addition to the vertices, other given points may lie on the perimeter of the polygon). +Given a set of points on a plane, we define a convex hole to be a convex polygon having as vertices any of the given points and not containing any of the given points in its interior (in addition to the vertices, other given points may lie on the perimeter of the polygon). -As an example, the image below shows a set of twenty points and a few such convex holes. +As an example, the image below shows a set of twenty points and a few such convex holes. The convex hole shown as a red heptagon has an area equal to 1049694.5 square units, which is the highest possible area for a convex hole on the given set of points. @@ -46,7 +46,7 @@ What is the maximum area for a convex hole on the set containing the first 500 p ```yml tests: - text: euler252() should return 104924. - testString: 'assert.strictEqual(euler252(), 104924, ''euler252() should return 104924.'');' + testString: 'assert.strictEqual(euler252(), 104924, "euler252() should return 104924.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-253-tidying-up.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-253-tidying-up.english.md index 9a35c2556e..209a20e052 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-253-tidying-up.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-253-tidying-up.english.md @@ -38,7 +38,7 @@ Give your answer rounded to six decimal places. ```yml tests: - text: euler253() should return 11.492847. - testString: 'assert.strictEqual(euler253(), 11.492847, ''euler253() should return 11.492847.'');' + testString: 'assert.strictEqual(euler253(), 11.492847, "euler253() should return 11.492847.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-254-sums-of-digit-factorials.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-254-sums-of-digit-factorials.english.md index cd246ef803..00240df112 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-254-sums-of-digit-factorials.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-254-sums-of-digit-factorials.english.md @@ -30,7 +30,7 @@ What is ∑ sg(i) for 1 ≤ i ≤ 150? ```yml tests: - text: euler254() should return 8184523820510. - testString: 'assert.strictEqual(euler254(), 8184523820510, ''euler254() should return 8184523820510.'');' + testString: 'assert.strictEqual(euler254(), 8184523820510, "euler254() should return 8184523820510.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-255-rounded-square-roots.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-255-rounded-square-roots.english.md index dbc9966700..bde4714f76 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-255-rounded-square-roots.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-255-rounded-square-roots.english.md @@ -43,7 +43,7 @@ Note: The symbols ⌊x⌋ and ⌈x⌉ represent the floor function and ceiling f ```yml tests: - text: euler255() should return 4.447401118. - testString: 'assert.strictEqual(euler255(), 4.447401118, ''euler255() should return 4.447401118.'');' + testString: 'assert.strictEqual(euler255(), 4.447401118, "euler255() should return 4.447401118.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-256-tatami-free-rooms.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-256-tatami-free-rooms.english.md index f0acbc89de..d932f900ba 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-256-tatami-free-rooms.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-256-tatami-free-rooms.english.md @@ -45,7 +45,7 @@ Find the smallest room-size s for which T(s) = 200. ```yml tests: - text: euler256() should return 85765680. - testString: 'assert.strictEqual(euler256(), 85765680, ''euler256() should return 85765680.'');' + testString: 'assert.strictEqual(euler256(), 85765680, "euler256() should return 85765680.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-257-angular-bisectors.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-257-angular-bisectors.english.md index fa9f9802ec..67d875c440 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-257-angular-bisectors.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-257-angular-bisectors.english.md @@ -6,7 +6,7 @@ title: 'Problem 257: Angular Bisectors' ## Description
-Given is an integer sided triangle ABC with sides a ≤ b ≤ c. +Given is an integer sided triangle ABC with sides a ≤ b ≤ c. (AB = c, BC = a and AC = b). The angular bisectors of the triangle intersect the sides at points E, F and G (see picture below). @@ -32,7 +32,7 @@ How many triangles ABC with perimeter≤100,000,000 exist so that the ratio area ```yml tests: - text: euler257() should return 139012411. - testString: 'assert.strictEqual(euler257(), 139012411, ''euler257() should return 139012411.'');' + testString: 'assert.strictEqual(euler257(), 139012411, "euler257() should return 139012411.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-258-a-lagged-fibonacci-sequence.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-258-a-lagged-fibonacci-sequence.english.md index ba4f759f9d..6cf7d8257b 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-258-a-lagged-fibonacci-sequence.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-258-a-lagged-fibonacci-sequence.english.md @@ -24,7 +24,7 @@ Find gk mod 20092010 for k = 1018. ```yml tests: - text: euler258() should return 12747994. - testString: 'assert.strictEqual(euler258(), 12747994, ''euler258() should return 12747994.'');' + testString: 'assert.strictEqual(euler258(), 12747994, "euler258() should return 12747994.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-259-reachable-numbers.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-259-reachable-numbers.english.md index 7d1ebfe470..9e2c585906 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-259-reachable-numbers.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-259-reachable-numbers.english.md @@ -30,7 +30,7 @@ What is the sum of all positive reachable integers? ```yml tests: - text: euler259() should return 20101196798. - testString: 'assert.strictEqual(euler259(), 20101196798, ''euler259() should return 20101196798.'');' + testString: 'assert.strictEqual(euler259(), 20101196798, "euler259() should return 20101196798.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-26-reciprocal-cycles.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-26-reciprocal-cycles.english.md index c9efc63631..37c1d4e745 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-26-reciprocal-cycles.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-26-reciprocal-cycles.english.md @@ -23,13 +23,13 @@ Find the value of d < n for which 1/dreciprocalCycles(700) should return 659. - testString: 'assert(reciprocalCycles(700) == 659, ''reciprocalCycles(700) should return 659.'');' + testString: 'assert(reciprocalCycles(700) == 659, "reciprocalCycles(700) should return 659.");' - text: reciprocalCycles(800) should return 743. - testString: 'assert(reciprocalCycles(800) == 743, ''reciprocalCycles(800) should return 743.'');' + testString: 'assert(reciprocalCycles(800) == 743, "reciprocalCycles(800) should return 743.");' - text: reciprocalCycles(900) should return 887. - testString: 'assert(reciprocalCycles(900) == 887, ''reciprocalCycles(900) should return 887.'');' + testString: 'assert(reciprocalCycles(900) == 887, "reciprocalCycles(900) should return 887.");' - text: reciprocalCycles(1000) should return 983. - testString: 'assert(reciprocalCycles(1000) == 983, ''reciprocalCycles(1000) should return 983.'');' + testString: 'assert(reciprocalCycles(1000) == 983, "reciprocalCycles(1000) should return 983.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-260-stone-game.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-260-stone-game.english.md index eacb5b452f..94d952d459 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-260-stone-game.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-260-stone-game.english.md @@ -18,7 +18,7 @@ The player taking the last stone(s) wins the game. A winning configuration is one where the first player can force a win. For example, (0,0,13), (0,11,11) and (5,5,5) are winning configurations because the first player can immediately remove all stones. -A losing configuration is one where the second player can force a win, no matter what the first player does. +A losing configuration is one where the second player can force a win, no matter what the first player does. For example, (0,1,2) and (1,3,3) are losing configurations: any legal move leaves a winning configuration for the second player. Consider all losing configurations (xi,yi,zi) where xi ≤ yi ≤ zi ≤ 100. @@ -39,7 +39,7 @@ with xi ≤ yi ≤ zi ≤ 1000. ```yml tests: - text: euler260() should return 167542057. - testString: 'assert.strictEqual(euler260(), 167542057, ''euler260() should return 167542057.'');' + testString: 'assert.strictEqual(euler260(), 167542057, "euler260() should return 167542057.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-261-pivotal-square-sums.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-261-pivotal-square-sums.english.md index 1dae006d05..f7be03a1ea 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-261-pivotal-square-sums.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-261-pivotal-square-sums.english.md @@ -29,7 +29,7 @@ Some small square-pivots are ```yml tests: - text: euler261() should return 238890850232021. - testString: 'assert.strictEqual(euler261(), 238890850232021, ''euler261() should return 238890850232021.'');' + testString: 'assert.strictEqual(euler261(), 238890850232021, "euler261() should return 238890850232021.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-262-mountain-range.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-262-mountain-range.english.md index 814fb77054..aa92716c09 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-262-mountain-range.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-262-mountain-range.english.md @@ -35,7 +35,7 @@ h=( 5000-0.005*(x*x+y*y+x*y)+12.5*(x+y) ) * exp( -abs(0.000001*(x*x+y*y)-0.0015* ```yml tests: - text: euler262() should return 2531.205. - testString: 'assert.strictEqual(euler262(), 2531.205, ''euler262() should return 2531.205.'');' + testString: 'assert.strictEqual(euler262(), 2531.205, "euler262() should return 2531.205.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-263-an-engineers-dream-come-true.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-263-an-engineers-dream-come-true.english.md index bf6940915d..5d02c60acc 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-263-an-engineers-dream-come-true.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-263-an-engineers-dream-come-true.english.md @@ -1,7 +1,7 @@ --- id: 5900f4741000cf542c50ff86 challengeType: 5 -title: 'Problem 263: An engineers'' dream come true' +title: 'Problem 263: An engineers" dream come true' --- ## Description @@ -19,7 +19,7 @@ We may occasionally find a triple-pair, which means three consecutive sexy prime We shall call a number n such that : -(n-9, n-3), (n-3,n+3), (n+3, n+9) form a triple-pair, and +(n-9, n-3), (n-3,n+3), (n+3, n+9) form a triple-pair, and the numbers n-8, n-4, n, n+4 and n+8 are all practical, an engineers’ paradise. @@ -39,7 +39,7 @@ Find the sum of the first four engineers’ paradises. ```yml tests: - text: euler263() should return 2039506520. - testString: 'assert.strictEqual(euler263(), 2039506520, ''euler263() should return 2039506520.'');' + testString: 'assert.strictEqual(euler263(), 2039506520, "euler263() should return 2039506520.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-264-triangle-centres.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-264-triangle-centres.english.md index b0f8e62744..a194a9d8b0 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-264-triangle-centres.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-264-triangle-centres.english.md @@ -40,7 +40,7 @@ Enter as your answer the sum of their perimeters rounded to four decimal places. ```yml tests: - text: euler264() should return 2816417.1055. - testString: 'assert.strictEqual(euler264(), 2816417.1055, ''euler264() should return 2816417.1055.'');' + testString: 'assert.strictEqual(euler264(), 2816417.1055, "euler264() should return 2816417.1055.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-265-binary-circles.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-265-binary-circles.english.md index 66ff877293..ca54d2b0af 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-265-binary-circles.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-265-binary-circles.english.md @@ -33,7 +33,7 @@ Find S(5). ```yml tests: - text: euler265() should return 209110240768. - testString: 'assert.strictEqual(euler265(), 209110240768, ''euler265() should return 209110240768.'');' + testString: 'assert.strictEqual(euler265(), 209110240768, "euler265() should return 209110240768.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-266-pseudo-square-root.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-266-pseudo-square-root.english.md index fdf3d021e2..cdd6b14bc3 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-266-pseudo-square-root.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-266-pseudo-square-root.english.md @@ -27,7 +27,7 @@ Find PSR(p) mod 1016. ```yml tests: - text: euler266() should return 1096883702440585. - testString: 'assert.strictEqual(euler266(), 1096883702440585, ''euler266() should return 1096883702440585.'');' + testString: 'assert.strictEqual(euler266(), 1096883702440585, "euler266() should return 1096883702440585.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-267-billionaire.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-267-billionaire.english.md index e3e3a23d13..75fd0ea438 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-267-billionaire.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-267-billionaire.english.md @@ -25,7 +25,7 @@ All computations are assumed to be exact (no rounding), but give your answer rou ```yml tests: - text: euler267() should return 0.999992836187. - testString: 'assert.strictEqual(euler267(), 0.999992836187, ''euler267() should return 0.999992836187.'');' + testString: 'assert.strictEqual(euler267(), 0.999992836187, "euler267() should return 0.999992836187.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-268-counting-numbers-with-at-least-four-distinct-prime-factors-less-than-100.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-268-counting-numbers-with-at-least-four-distinct-prime-factors-less-than-100.english.md index f1375b7ce0..b19b67c9b3 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-268-counting-numbers-with-at-least-four-distinct-prime-factors-less-than-100.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-268-counting-numbers-with-at-least-four-distinct-prime-factors-less-than-100.english.md @@ -22,7 +22,7 @@ Find how many positive integers less than 1016 are divisible by at least four di ```yml tests: - text: euler268() should return 785478606870985. - testString: 'assert.strictEqual(euler268(), 785478606870985, ''euler268() should return 785478606870985.'');' + testString: 'assert.strictEqual(euler268(), 785478606870985, "euler268() should return 785478606870985.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-269-polynomials-with-at-least-one-integer-root.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-269-polynomials-with-at-least-one-integer-root.english.md index 05ebc604a5..f35d720d6f 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-269-polynomials-with-at-least-one-integer-root.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-269-polynomials-with-at-least-one-integer-root.english.md @@ -6,7 +6,7 @@ title: 'Problem 269: Polynomials with at least one integer root' ## Description
-A root or zero of a polynomial P(x) is a solution to the equation P(x) = 0. +A root or zero of a polynomial P(x) is a solution to the equation P(x) = 0. Define Pn as the polynomial whose coefficients are the digits of n. For example, P5703(x) = 5x3 + 7x2 + 3. @@ -30,7 +30,7 @@ What is Z(1016)? ```yml tests: - text: euler269() should return 1311109198529286. - testString: 'assert.strictEqual(euler269(), 1311109198529286, ''euler269() should return 1311109198529286.'');' + testString: 'assert.strictEqual(euler269(), 1311109198529286, "euler269() should return 1311109198529286.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-27-quadratic-primes.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-27-quadratic-primes.english.md index bbba3e62c5..ff974c392e 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-27-quadratic-primes.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-27-quadratic-primes.english.md @@ -28,13 +28,13 @@ Find the product of the coefficients, $a$ and $b$, for the quadratic expression ```yml tests: - text: quadraticPrimes(200) should return -4925. - testString: 'assert(quadraticPrimes(200) == -4925, ''quadraticPrimes(200) should return -4925.'');' + testString: 'assert(quadraticPrimes(200) == -4925, "quadraticPrimes(200) should return -4925.");' - text: quadraticPrimes(500) should return -18901. - testString: 'assert(quadraticPrimes(500) == -18901, ''quadraticPrimes(500) should return -18901.'');' + testString: 'assert(quadraticPrimes(500) == -18901, "quadraticPrimes(500) should return -18901.");' - text: quadraticPrimes(800) should return -43835. - testString: 'assert(quadraticPrimes(800) == -43835, ''quadraticPrimes(800) should return -43835.'');' + testString: 'assert(quadraticPrimes(800) == -43835, "quadraticPrimes(800) should return -43835.");' - text: quadraticPrimes(1000) should return -59231. - testString: 'assert(quadraticPrimes(1000) == -59231, ''quadraticPrimes(1000) should return -59231.'');' + testString: 'assert(quadraticPrimes(1000) == -59231, "quadraticPrimes(1000) should return -59231.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-270-cutting-squares.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-270-cutting-squares.english.md index ba90819314..8ed3ee075e 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-270-cutting-squares.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-270-cutting-squares.english.md @@ -27,7 +27,7 @@ What is C(30) mod 108 ? ```yml tests: - text: euler270() should return 82282080. - testString: 'assert.strictEqual(euler270(), 82282080, ''euler270() should return 82282080.'');' + testString: 'assert.strictEqual(euler270(), 82282080, "euler270() should return 82282080.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-271-modular-cubes-part-1.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-271-modular-cubes-part-1.english.md index 0ae821db31..bf88bb27e0 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-271-modular-cubes-part-1.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-271-modular-cubes-part-1.english.md @@ -26,7 +26,7 @@ Find S(13082761331670030). ```yml tests: - text: euler271() should return 4617456485273130000. - testString: 'assert.strictEqual(euler271(), 4617456485273130000, ''euler271() should return 4617456485273130000.'');' + testString: 'assert.strictEqual(euler271(), 4617456485273130000, "euler271() should return 4617456485273130000.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-272-modular-cubes-part-2.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-272-modular-cubes-part-2.english.md index b4cb965cc4..284cd17d73 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-272-modular-cubes-part-2.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-272-modular-cubes-part-2.english.md @@ -26,7 +26,7 @@ Find the sum of the positive numbers n≤1011 for which C(n)=242. ```yml tests: - text: euler272() should return 8495585919506151000. - testString: 'assert.strictEqual(euler272(), 8495585919506151000, ''euler272() should return 8495585919506151000.'');' + testString: 'assert.strictEqual(euler272(), 8495585919506151000, "euler272() should return 8495585919506151000.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-273-sum-of-squares.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-273-sum-of-squares.english.md index ec0680b665..aa848583bc 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-273-sum-of-squares.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-273-sum-of-squares.english.md @@ -26,7 +26,7 @@ Find ∑S(N), for all squarefree N only divisible by primes of the form 4k+1 wit ```yml tests: - text: euler273() should return 2032447591196869000. - testString: 'assert.strictEqual(euler273(), 2032447591196869000, ''euler273() should return 2032447591196869000.'');' + testString: 'assert.strictEqual(euler273(), 2032447591196869000, "euler273() should return 2032447591196869000.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-274-divisibility-multipliers.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-274-divisibility-multipliers.english.md index bde90033d3..174028f934 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-274-divisibility-multipliers.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-274-divisibility-multipliers.english.md @@ -32,7 +32,7 @@ The sum of the divisibility multipliers for the primes that are coprime to 10 an ```yml tests: - text: euler274() should return 1601912348822. - testString: 'assert.strictEqual(euler274(), 1601912348822, ''euler274() should return 1601912348822.'');' + testString: 'assert.strictEqual(euler274(), 1601912348822, "euler274() should return 1601912348822.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-275-balanced-sculptures.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-275-balanced-sculptures.english.md index 06e31d640b..6ab3ab8e7e 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-275-balanced-sculptures.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-275-balanced-sculptures.english.md @@ -28,7 +28,7 @@ There are 964 balanced sculptures of order 10 and 360505 of order 15.How many ba ```yml tests: - text: euler275() should return 15030564. - testString: 'assert.strictEqual(euler275(), 15030564, ''euler275() should return 15030564.'');' + testString: 'assert.strictEqual(euler275(), 15030564, "euler275() should return 15030564.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-276-primitive-triangles.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-276-primitive-triangles.english.md index 9ccb9419d7..ecae87df67 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-276-primitive-triangles.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-276-primitive-triangles.english.md @@ -7,7 +7,7 @@ title: 'Problem 276: Primitive Triangles' ## Description
Consider the triangles with integer sides a, b and c with a ≤ b ≤ c. -An integer sided triangle (a,b,c) is called primitive if gcd(a,b,c)=1. +An integer sided triangle (a,b,c) is called primitive if gcd(a,b,c)=1. How many primitive integer sided triangles exist with a perimeter not exceeding 10 000 000?
@@ -22,7 +22,7 @@ How many primitive integer sided triangles exist with a perimeter not exceeding ```yml tests: - text: euler276() should return 5777137137739633000. - testString: 'assert.strictEqual(euler276(), 5777137137739633000, ''euler276() should return 5777137137739633000.'');' + testString: 'assert.strictEqual(euler276(), 5777137137739633000, "euler276() should return 5777137137739633000.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-277-a-modified-collatz-sequence.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-277-a-modified-collatz-sequence.english.md index bcae4bbddf..5398dd707c 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-277-a-modified-collatz-sequence.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-277-a-modified-collatz-sequence.english.md @@ -44,7 +44,7 @@ What is the smallest a1 > 1015 that begins with the sequence "UDDDUdddDDUDDddDdD ```yml tests: - text: euler277() should return 1125977393124310. - testString: 'assert.strictEqual(euler277(), 1125977393124310, ''euler277() should return 1125977393124310.'');' + testString: 'assert.strictEqual(euler277(), 1125977393124310, "euler277() should return 1125977393124310.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-278-linear-combinations-of-semiprimes.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-278-linear-combinations-of-semiprimes.english.md index 39eeb33601..2047de7679 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-278-linear-combinations-of-semiprimes.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-278-linear-combinations-of-semiprimes.english.md @@ -6,11 +6,11 @@ title: 'Problem 278: Linear Combinations of Semiprimes' ## Description
-Given the values of integers 1 < a1 < a2 <... < an, consider the linear combinationq1a1 + q2a2 + ... + qnan = b, using only integer values qk ≥ 0. +Given the values of integers 1 < a1 < a2 <... < an, consider the linear combinationq1a1 + q2a2 + ... + qnan = b, using only integer values qk ≥ 0. Note that for a given set of ak, it may be that not all values of b are possible. -For instance, if a1 = 5 and a2 = 7, there are no q1 ≥ 0 and q2 ≥ 0 such that b could be +For instance, if a1 = 5 and a2 = 7, there are no q1 ≥ 0 and q2 ≥ 0 such that b could be 1, 2, 3, 4, 6, 8, 9, 11, 13, 16, 18 or 23. In fact, 23 is the largest impossible value of b for a1 = 5 and a2 = 7. We therefore call f(5, 7) = 23. Similarly, it can be shown that f(6, 10, 15)=29 and f(14, 22, 77) = 195. @@ -30,7 +30,7 @@ Find ∑ f(p*q,p*r,q*r), where p, q and r are prime numbers and p < q < r < 5000 ```yml tests: - text: euler278() should return 1228215747273908500. - testString: 'assert.strictEqual(euler278(), 1228215747273908500, ''euler278() should return 1228215747273908500.'');' + testString: 'assert.strictEqual(euler278(), 1228215747273908500, "euler278() should return 1228215747273908500.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-279-triangles-with-integral-sides-and-an-integral-angle.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-279-triangles-with-integral-sides-and-an-integral-angle.english.md index 37682687d5..865e2bfdd2 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-279-triangles-with-integral-sides-and-an-integral-angle.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-279-triangles-with-integral-sides-and-an-integral-angle.english.md @@ -20,7 +20,7 @@ How many triangles are there with integral sides, at least one integral angle (m ```yml tests: - text: euler279() should return 416577688. - testString: 'assert.strictEqual(euler279(), 416577688, ''euler279() should return 416577688.'');' + testString: 'assert.strictEqual(euler279(), 416577688, "euler279() should return 416577688.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-28-number-spiral-diagonals.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-28-number-spiral-diagonals.english.md index 06af4b5c9f..627716adfc 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-28-number-spiral-diagonals.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-28-number-spiral-diagonals.english.md @@ -27,13 +27,13 @@ What is the sum of the numbers on the diagonals in a n by n spiral formed in the ```yml tests: - text: spiralDiagonals(101) should return 692101. - testString: 'assert(spiralDiagonals(101) == 692101, ''spiralDiagonals(101) should return 692101.'');' + testString: 'assert(spiralDiagonals(101) == 692101, "spiralDiagonals(101) should return 692101.");' - text: spiralDiagonals(303) should return 18591725. - testString: 'assert(spiralDiagonals(303) == 18591725, ''spiralDiagonals(303) should return 18591725.'');' + testString: 'assert(spiralDiagonals(303) == 18591725, "spiralDiagonals(303) should return 18591725.");' - text: spiralDiagonals(505) should return 85986601. - testString: 'assert(spiralDiagonals(505) == 85986601, ''spiralDiagonals(505) should return 85986601.'');' + testString: 'assert(spiralDiagonals(505) == 85986601, "spiralDiagonals(505) should return 85986601.");' - text: spiralDiagonals(1001) should return 669171001. - testString: 'assert(spiralDiagonals(1001) == 669171001, ''spiralDiagonals(1001) should return 669171001.'');' + testString: 'assert(spiralDiagonals(1001) == 669171001, "spiralDiagonals(1001) should return 669171001.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-280-ant-and-seeds.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-280-ant-and-seeds.english.md index 5b6601a893..08b5d2e06d 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-280-ant-and-seeds.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-280-ant-and-seeds.english.md @@ -10,7 +10,7 @@ A laborious ant walks randomly on a 5x5 grid. The walk starts from the central s At the start of the walk, a seed is placed on each square of the lower row. When the ant isn't carrying a seed and reaches a square of the lower row containing a seed, it will start to carry the seed. The ant will drop the seed on the first empty square of the upper row it eventually reaches. -What's the expected number of steps until all seeds have been dropped in the top row? +What's the expected number of steps until all seeds have been dropped in the top row? Give your answer rounded to 6 decimal places.
@@ -25,7 +25,7 @@ Give your answer rounded to 6 decimal places. ```yml tests: - text: euler280() should return 430.088247. - testString: 'assert.strictEqual(euler280(), 430.088247, ''euler280() should return 430.088247.'');' + testString: 'assert.strictEqual(euler280(), 430.088247, "euler280() should return 430.088247.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-281-pizza-toppings.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-281-pizza-toppings.english.md index c7c8f5860e..ded32b6635 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-281-pizza-toppings.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-281-pizza-toppings.english.md @@ -8,7 +8,7 @@ title: 'Problem 281: Pizza Toppings'
You are given a pizza (perfect circle) that has been cut into m·n equal pieces and you want to have exactly one topping on each slice. -Let f(m,n) denote the number of ways you can have toppings on the pizza with m different toppings (m ≥ 2), using each topping on exactly n slices (n ≥ 1). Reflections are considered distinct, rotations are not. +Let f(m,n) denote the number of ways you can have toppings on the pizza with m different toppings (m ≥ 2), using each topping on exactly n slices (n ≥ 1). Reflections are considered distinct, rotations are not. Thus, for instance, f(2,1) = 1, f(2,2) = f(3,1) = 2 and f(3,2) = 16. f(3,2) is shown below: @@ -28,7 +28,7 @@ Find the sum of all f(m,n) such that f(m,n) ≤ 1015. ```yml tests: - text: euler281() should return 1485776387445623. - testString: 'assert.strictEqual(euler281(), 1485776387445623, ''euler281() should return 1485776387445623.'');' + testString: 'assert.strictEqual(euler281(), 1485776387445623, "euler281() should return 1485776387445623.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-282-the-ackermann-function.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-282-the-ackermann-function.english.md index 085a668de1..2ff63bd217 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-282-the-ackermann-function.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-282-the-ackermann-function.english.md @@ -27,7 +27,7 @@ Find A(n, n) and give your answer mod 148. ```yml tests: - text: euler282() should return 1098988351. - testString: 'assert.strictEqual(euler282(), 1098988351, ''euler282() should return 1098988351.'');' + testString: 'assert.strictEqual(euler282(), 1098988351, "euler282() should return 1098988351.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-283-integer-sided-triangles-for-which-the-area--perimeter-ratio-is-integral.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-283-integer-sided-triangles-for-which-the-area--perimeter-ratio-is-integral.english.md index b2e3182a7b..089960c809 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-283-integer-sided-triangles-for-which-the-area--perimeter-ratio-is-integral.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-283-integer-sided-triangles-for-which-the-area--perimeter-ratio-is-integral.english.md @@ -6,9 +6,9 @@ title: 'Problem 283: Integer sided triangles for which the area * perimeter rati ## Description
-Consider the triangle with sides 6, 8 and 10. It can be seen that the perimeter and the area are both equal to 24. +Consider the triangle with sides 6, 8 and 10. It can be seen that the perimeter and the area are both equal to 24. So the area/perimeter ratio is equal to 1. -Consider also the triangle with sides 13, 14 and 15. The perimeter equals 42 while the area is equal to 84. +Consider also the triangle with sides 13, 14 and 15. The perimeter equals 42 while the area is equal to 84. So for this triangle the area/perimeter ratio is equal to 2. @@ -26,7 +26,7 @@ Find the sum of the perimeters of all integer sided triangles for which the area ```yml tests: - text: euler283() should return 28038042525570324. - testString: 'assert.strictEqual(euler283(), 28038042525570324, ''euler283() should return 28038042525570324.'');' + testString: 'assert.strictEqual(euler283(), 28038042525570324, "euler283() should return 28038042525570324.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-284-steady-squares.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-284-steady-squares.english.md index 9df0e460df..c2681399fd 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-284-steady-squares.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-284-steady-squares.english.md @@ -27,7 +27,7 @@ Find the sum of the digits of all the n-digit steady squares in the base 14 numb ```yml tests: - text: euler284() should return 5a411d7b. - testString: 'assert.strictEqual(euler284(), 5a411d7b, ''euler284() should return 5a411d7b.'');' + testString: 'assert.strictEqual(euler284(), 5a411d7b, "euler284() should return 5a411d7b.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-285-pythagorean-odds.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-285-pythagorean-odds.english.md index 30b5a09ca9..be099a45d0 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-285-pythagorean-odds.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-285-pythagorean-odds.english.md @@ -29,7 +29,7 @@ If he plays 105 turns with k = 1, k = 2, k = 3, ..., k = 105, wh ```yml tests: - text: euler285() should return 157055.80999. - testString: 'assert.strictEqual(euler285(), 157055.80999, ''euler285() should return 157055.80999.'');' + testString: 'assert.strictEqual(euler285(), 157055.80999, "euler285() should return 157055.80999.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-286-scoring-probabilities.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-286-scoring-probabilities.english.md index 57e90df54b..594338e86e 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-286-scoring-probabilities.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-286-scoring-probabilities.english.md @@ -24,7 +24,7 @@ Find q and give your answer rounded to 10 decimal places. ```yml tests: - text: euler286() should return 52.6494571953. - testString: 'assert.strictEqual(euler286(), 52.6494571953, ''euler286() should return 52.6494571953.'');' + testString: 'assert.strictEqual(euler286(), 52.6494571953, "euler286() should return 52.6494571953.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-287-quadtree-encoding-a-simple-compression-algorithm.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-287-quadtree-encoding-a-simple-compression-algorithm.english.md index 0c788da865..03122423b5 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-287-quadtree-encoding-a-simple-compression-algorithm.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-287-quadtree-encoding-a-simple-compression-algorithm.english.md @@ -35,7 +35,7 @@ otherwise the pixel is white.What is the length of the minimal sequence describi ```yml tests: - text: euler287() should return 313135496. - testString: 'assert.strictEqual(euler287(), 313135496, ''euler287() should return 313135496.'');' + testString: 'assert.strictEqual(euler287(), 313135496, "euler287() should return 313135496.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-288-an-enormous-factorial.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-288-an-enormous-factorial.english.md index 1ed0ff55c3..4735217955 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-288-an-enormous-factorial.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-288-an-enormous-factorial.english.md @@ -35,7 +35,7 @@ Find NF(61,107) mod 6110 ```yml tests: - text: euler288() should return 605857431263982000. - testString: 'assert.strictEqual(euler288(), 605857431263982000, ''euler288() should return 605857431263982000.'');' + testString: 'assert.strictEqual(euler288(), 605857431263982000, "euler288() should return 605857431263982000.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-289-eulerian-cycles.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-289-eulerian-cycles.english.md index 9fec659040..2b242b326c 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-289-eulerian-cycles.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-289-eulerian-cycles.english.md @@ -12,7 +12,7 @@ For positive integers m and n, let E(m,n) be a configuration which consists of t { C(x,y): 0 ≤ x < m, 0 ≤ y < n, x and y are integers } An Eulerian cycle on E(m,n) is a closed path that passes through each arc exactly once. -Many such paths are possible on E(m,n), but we are only interested in those which are not self-crossing: +Many such paths are possible on E(m,n), but we are only interested in those which are not self-crossing: A non-crossing path just touches itself at lattice points, but it never crosses itself. The image below shows E(3,3) and an example of an Eulerian non-crossing path. @@ -34,7 +34,7 @@ Find L(6,10) mod 1010. ```yml tests: - text: euler289() should return 6567944538. - testString: 'assert.strictEqual(euler289(), 6567944538, ''euler289() should return 6567944538.'');' + testString: 'assert.strictEqual(euler289(), 6567944538, "euler289() should return 6567944538.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-29-distinct-powers.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-29-distinct-powers.english.md index e7e8ffc648..71cd15b1e6 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-29-distinct-powers.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-29-distinct-powers.english.md @@ -27,13 +27,13 @@ How many distinct terms are in the sequence generated by ab for 2 ≤ a ≤ n an ```yml tests: - text: distinctPowers(15) should return 177. - testString: 'assert.strictEqual(distinctPowers(15), 177, ''distinctPowers(15) should return 177.'');' + testString: 'assert.strictEqual(distinctPowers(15), 177, "distinctPowers(15) should return 177.");' - text: distinctPowers(20) should return 324. - testString: 'assert.strictEqual(distinctPowers(20), 324, ''distinctPowers(20) should return 324.'');' + testString: 'assert.strictEqual(distinctPowers(20), 324, "distinctPowers(20) should return 324.");' - text: distinctPowers(25) should return 519. - testString: 'assert.strictEqual(distinctPowers(25), 519, ''distinctPowers(25) should return 519.'');' + testString: 'assert.strictEqual(distinctPowers(25), 519, "distinctPowers(25) should return 519.");' - text: distinctPowers(30) should return 755. - testString: 'assert.strictEqual(distinctPowers(30), 755, ''distinctPowers(30) should return 755.'');' + testString: 'assert.strictEqual(distinctPowers(30), 755, "distinctPowers(30) should return 755.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-290-digital-signature.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-290-digital-signature.english.md index 33878c7a34..09e197dc8d 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-290-digital-signature.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-290-digital-signature.english.md @@ -20,7 +20,7 @@ How many integers 0 ≤ n < 1018 have the property that the sum of the digits of ```yml tests: - text: euler290() should return 20444710234716470. - testString: 'assert.strictEqual(euler290(), 20444710234716470, ''euler290() should return 20444710234716470.'');' + testString: 'assert.strictEqual(euler290(), 20444710234716470, "euler290() should return 20444710234716470.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-291-panaitopol-primes.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-291-panaitopol-primes.english.md index 35900679e7..58d97d9c43 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-291-panaitopol-primes.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-291-panaitopol-primes.english.md @@ -23,7 +23,7 @@ Find how many Panaitopol primes are less than 5×1015. ```yml tests: - text: euler291() should return 4037526. - testString: 'assert.strictEqual(euler291(), 4037526, ''euler291() should return 4037526.'');' + testString: 'assert.strictEqual(euler291(), 4037526, "euler291() should return 4037526.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-292-pythagorean-polygons.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-292-pythagorean-polygons.english.md index c3b0708f4b..53ab446de0 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-292-pythagorean-polygons.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-292-pythagorean-polygons.english.md @@ -27,7 +27,7 @@ Find P(120). ```yml tests: - text: euler292() should return 3600060866. - testString: 'assert.strictEqual(euler292(), 3600060866, ''euler292() should return 3600060866.'');' + testString: 'assert.strictEqual(euler292(), 3600060866, "euler292() should return 3600060866.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-293-pseudo-fortunate-numbers.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-293-pseudo-fortunate-numbers.english.md index ecab14c99e..2ac3784fba 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-293-pseudo-fortunate-numbers.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-293-pseudo-fortunate-numbers.english.md @@ -13,7 +13,7 @@ The first twelve admissible numbers are 2,4,6,8,12,16,18,24,30,32,36,48. If N is admissible, the smallest integer M > 1 such that N+M is prime, will be called the pseudo-Fortunate number for N. -For example, N=630 is admissible since it is even and its distinct prime factors are the consecutive primes 2,3,5 and 7. +For example, N=630 is admissible since it is even and its distinct prime factors are the consecutive primes 2,3,5 and 7. The next prime number after 631 is 641; hence, the pseudo-Fortunate number for 630 is M=11. It can also be seen that the pseudo-Fortunate number for 16 is 3. @@ -32,7 +32,7 @@ Find the sum of all distinct pseudo-Fortunate numbers for admissible numbers N l ```yml tests: - text: euler293() should return 2209. - testString: 'assert.strictEqual(euler293(), 2209, ''euler293() should return 2209.'');' + testString: 'assert.strictEqual(euler293(), 2209, "euler293() should return 2209.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-294-sum-of-digits---experience-23.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-294-sum-of-digits---experience-23.english.md index b3b38f41a6..7201b955ef 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-294-sum-of-digits---experience-23.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-294-sum-of-digits---experience-23.english.md @@ -31,7 +31,7 @@ Find S(1112) and give your answer mod 109. ```yml tests: - text: euler294() should return 789184709. - testString: 'assert.strictEqual(euler294(), 789184709, ''euler294() should return 789184709.'');' + testString: 'assert.strictEqual(euler294(), 789184709, "euler294() should return 789184709.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-295-lenticular-holes.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-295-lenticular-holes.english.md index 0eeed48000..0db37a5ea4 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-295-lenticular-holes.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-295-lenticular-holes.english.md @@ -42,7 +42,7 @@ Find L(100 000). ```yml tests: - text: euler295() should return 4884650818. - testString: 'assert.strictEqual(euler295(), 4884650818, ''euler295() should return 4884650818.'');' + testString: 'assert.strictEqual(euler295(), 4884650818, "euler295() should return 4884650818.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-296-angular-bisector-and-tangent.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-296-angular-bisector-and-tangent.english.md index 1e1dd2c036..29ef98b7b1 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-296-angular-bisector-and-tangent.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-296-angular-bisector-and-tangent.english.md @@ -25,7 +25,7 @@ How many triangles ABC with a perimeter not exceeding 100 000 exist such that BE ```yml tests: - text: euler296() should return 1137208419. - testString: 'assert.strictEqual(euler296(), 1137208419, ''euler296() should return 1137208419.'');' + testString: 'assert.strictEqual(euler296(), 1137208419, "euler296() should return 1137208419.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-297-zeckendorf-representation.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-297-zeckendorf-representation.english.md index 65e017c6d9..284581f7fc 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-297-zeckendorf-representation.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-297-zeckendorf-representation.english.md @@ -30,7 +30,7 @@ Find ∑ z(n) for 0euler297() should return 2252639041804718000. - testString: 'assert.strictEqual(euler297(), 2252639041804718000, ''euler297() should return 2252639041804718000.'');' + testString: 'assert.strictEqual(euler297(), 2252639041804718000, "euler297() should return 2252639041804718000.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-298-selective-amnesia.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-298-selective-amnesia.english.md index f52d3356a6..678602b073 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-298-selective-amnesia.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-298-selective-amnesia.english.md @@ -94,7 +94,7 @@ Denoting Larry's score by L and Robin's score by R, what is the expected value o ```yml tests: - text: euler298() should return 1.76882294. - testString: 'assert.strictEqual(euler298(), 1.76882294, ''euler298() should return 1.76882294.'');' + testString: 'assert.strictEqual(euler298(), 1.76882294, "euler298() should return 1.76882294.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-299-three-similar-triangles.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-299-three-similar-triangles.english.md index 3e8347d603..79c8a0eb7a 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-299-three-similar-triangles.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-299-three-similar-triangles.english.md @@ -6,7 +6,7 @@ title: 'Problem 299: Three similar triangles' ## Description
-Four points with integer coordinates are selected:A(a, 0), B(b, 0), C(0, c) and D(0, d), +Four points with integer coordinates are selected:A(a, 0), B(b, 0), C(0, c) and D(0, d), with 0 < a < b and 0 < c < d. Point P, also with integer coordinates, is chosen on the line AC so that the three triangles ABP, CDP and BDP are all similar. @@ -14,7 +14,7 @@ It is easy to prove that the three triangles can be similar, only if a=c. So, given that a=c, we are looking for triplets (a,b,d) such that at least one point P (with integer coordinates) exists on AC, making the three triangles ABP, CDP and BDP all similar. -For example, if (a,b,d)=(2,3,4), it can be easily verified that point P(1,1) satisfies the above condition. +For example, if (a,b,d)=(2,3,4), it can be easily verified that point P(1,1) satisfies the above condition. Note that the triplets (2,3,4) and (2,4,3) are considered as distinct, although point P(1,1) is common for both. If b+d < 100, there are 92 distinct triplets (a,b,d) such that point P exists. @@ -33,7 +33,7 @@ If b+d < 100 000 000, how many distinct triplets (a,b,d) are there such that p ```yml tests: - text: euler299() should return 549936643. - testString: 'assert.strictEqual(euler299(), 549936643, ''euler299() should return 549936643.'');' + testString: 'assert.strictEqual(euler299(), 549936643, "euler299() should return 549936643.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-3-largest-prime-factor.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-3-largest-prime-factor.english.md index 1d2a0f4b41..0b276ea243 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-3-largest-prime-factor.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-3-largest-prime-factor.english.md @@ -21,17 +21,17 @@ What is the largest prime factor of the given number? ```yml tests: - text: largestPrimeFactor(2) should return 2. - testString: 'assert.strictEqual(largestPrimeFactor(2), 2, ''largestPrimeFactor(2) should return 2.'');' + testString: 'assert.strictEqual(largestPrimeFactor(2), 2, "largestPrimeFactor(2) should return 2.");' - text: largestPrimeFactor(3) should return 3. - testString: 'assert.strictEqual(largestPrimeFactor(3), 3, ''largestPrimeFactor(3) should return 3.'');' + testString: 'assert.strictEqual(largestPrimeFactor(3), 3, "largestPrimeFactor(3) should return 3.");' - text: largestPrimeFactor(5) should return 5. - testString: 'assert.strictEqual(largestPrimeFactor(5), 5, ''largestPrimeFactor(5) should return 5.'');' + testString: 'assert.strictEqual(largestPrimeFactor(5), 5, "largestPrimeFactor(5) should return 5.");' - text: largestPrimeFactor(7) should return 7. - testString: 'assert.strictEqual(largestPrimeFactor(7), 7, ''largestPrimeFactor(7) should return 7.'');' + testString: 'assert.strictEqual(largestPrimeFactor(7), 7, "largestPrimeFactor(7) should return 7.");' - text: largestPrimeFactor(13195) should return 29. - testString: 'assert.strictEqual(largestPrimeFactor(13195), 29, ''largestPrimeFactor(13195) should return 29.'');' + testString: 'assert.strictEqual(largestPrimeFactor(13195), 29, "largestPrimeFactor(13195) should return 29.");' - text: largestPrimeFactor(600851475143) should return 6857. - testString: 'assert.strictEqual(largestPrimeFactor(600851475143), 6857, ''largestPrimeFactor(600851475143) should return 6857.'');' + testString: 'assert.strictEqual(largestPrimeFactor(600851475143), 6857, "largestPrimeFactor(600851475143) should return 6857.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-30-digit-n-powers.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-30-digit-n-powers.english.md index 45ebf7e87a..4bfb3c4ef4 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-30-digit-n-powers.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-30-digit-n-powers.english.md @@ -26,13 +26,13 @@ Find the sum of all the numbers that can be written as the sum of n powers of th ```yml tests: - text: digitnPowers(2) should return 0. - testString: 'assert(digitnPowers(2) == 0, ''digitnPowers(2) should return 0.'');' + testString: 'assert(digitnPowers(2) == 0, "digitnPowers(2) should return 0.");' - text: digitnPowers(3) should return 1301. - testString: 'assert(digitnPowers(3) == 1301, ''digitnPowers(3) should return 1301.'');' + testString: 'assert(digitnPowers(3) == 1301, "digitnPowers(3) should return 1301.");' - text: digitnPowers(4) should return 19316. - testString: 'assert(digitnPowers(4) == 19316, ''digitnPowers(4) should return 19316.'');' + testString: 'assert(digitnPowers(4) == 19316, "digitnPowers(4) should return 19316.");' - text: digitnPowers(5) should return 443839. - testString: 'assert(digitnPowers(5) == 443839, ''digitnPowers(5) should return 443839.'');' + testString: 'assert(digitnPowers(5) == 443839, "digitnPowers(5) should return 443839.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-300-protein-folding.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-300-protein-folding.english.md index 9da47f4773..6184b873a4 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-300-protein-folding.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-300-protein-folding.english.md @@ -6,7 +6,7 @@ title: 'Problem 300: Protein folding' ## Description
-In a very simplified form, we can consider proteins as strings consisting of hydrophobic (H) and polar (P) elements, e.g. HHPPHHHPHHPH. +In a very simplified form, we can consider proteins as strings consisting of hydrophobic (H) and polar (P) elements, e.g. HHPPHHHPHHPH. For this problem, the orientation of a protein is important; e.g. HPP is considered distinct from PPH. Thus, there are 2n distinct proteins consisting of n elements. When one encounters these strings in nature, they are always folded in such a way that the number of H-H contact points is as large as possible, since this is energetically advantageous. @@ -37,7 +37,7 @@ Give your answer using as many decimal places as necessary for an exact result. ```yml tests: - text: euler300() should return 8.0540771484375. - testString: 'assert.strictEqual(euler300(), 8.0540771484375, ''euler300() should return 8.0540771484375.'');' + testString: 'assert.strictEqual(euler300(), 8.0540771484375, "euler300() should return 8.0540771484375.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-301-nim.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-301-nim.english.md index f1be4bc9a8..7bedff04a5 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-301-nim.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-301-nim.english.md @@ -35,7 +35,7 @@ For how many positive integers n ≤ 230 does X(n,2n,3n) = 0 ? ```yml tests: - text: euler301() should return 2178309. - testString: 'assert.strictEqual(euler301(), 2178309, ''euler301() should return 2178309.'');' + testString: 'assert.strictEqual(euler301(), 2178309, "euler301() should return 2178309.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-302-strong-achilles-numbers.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-302-strong-achilles-numbers.english.md index 359b070a1b..3d1f616401 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-302-strong-achilles-numbers.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-302-strong-achilles-numbers.english.md @@ -38,7 +38,7 @@ How many Strong Achilles numbers are there below 1018? ```yml tests: - text: euler302() should return 1170060. - testString: 'assert.strictEqual(euler302(), 1170060, ''euler302() should return 1170060.'');' + testString: 'assert.strictEqual(euler302(), 1170060, "euler302() should return 1170060.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-303-multiples-with-small-digits.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-303-multiples-with-small-digits.english.md index a5e8aca5b3..9e84e2e538 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-303-multiples-with-small-digits.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-303-multiples-with-small-digits.english.md @@ -24,7 +24,7 @@ Find . ```yml tests: - text: euler303() should return 1111981904675169. - testString: 'assert.strictEqual(euler303(), 1111981904675169, ''euler303() should return 1111981904675169.'');' + testString: 'assert.strictEqual(euler303(), 1111981904675169, "euler303() should return 1111981904675169.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-304-primonacci.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-304-primonacci.english.md index d28f12e488..f76ce0b3b8 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-304-primonacci.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-304-primonacci.english.md @@ -20,7 +20,7 @@ f(0)=0, f(1)=1 and f(n)=f(n-1)+f(n-2) for n>1. The sequence b(n) is defined as f(a(n)). -Find ∑b(n) for 1≤n≤100 000. +Find ∑b(n) for 1≤n≤100 000. Give your answer mod 1234567891011.
@@ -35,7 +35,7 @@ Give your answer mod 1234567891011. ```yml tests: - text: euler304() should return 283988410192. - testString: 'assert.strictEqual(euler304(), 283988410192, ''euler304() should return 283988410192.'');' + testString: 'assert.strictEqual(euler304(), 283988410192, "euler304() should return 283988410192.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-305-reflexive-position.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-305-reflexive-position.english.md index 3e862954b6..a9c1607a61 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-305-reflexive-position.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-305-reflexive-position.english.md @@ -6,14 +6,14 @@ title: 'Problem 305: Reflexive Position' ## Description
-Let's call S the (infinite) string that is made by concatenating the consecutive positive integers (starting from 1) written down in base 10. +Let's call S the (infinite) string that is made by concatenating the consecutive positive integers (starting from 1) written down in base 10. Thus, S = 1234567891011121314151617181920212223242... It's easy to see that any number will show up an infinite number of times in S. -Let's call f(n) the starting position of the nth occurrence of n in S. +Let's call f(n) the starting position of the nth occurrence of n in S. For example, f(1)=1, f(5)=81, f(12)=271 and f(7780)=111111365. @@ -31,7 +31,7 @@ Find ∑f(3k) for 1≤k≤13. ```yml tests: - text: euler305() should return 18174995535140. - testString: 'assert.strictEqual(euler305(), 18174995535140, ''euler305() should return 18174995535140.'');' + testString: 'assert.strictEqual(euler305(), 18174995535140, "euler305() should return 18174995535140.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-306-paper-strip-game.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-306-paper-strip-game.english.md index 15f1f4863f..b1300fefa7 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-306-paper-strip-game.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-306-paper-strip-game.english.md @@ -37,7 +37,7 @@ For 1 ≤ n ≤ 1 000 000, how many values of n are there for which the first pl ```yml tests: - text: euler306() should return 852938. - testString: 'assert.strictEqual(euler306(), 852938, ''euler306() should return 852938.'');' + testString: 'assert.strictEqual(euler306(), 852938, "euler306() should return 852938.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-307-chip-defects.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-307-chip-defects.english.md index c5a8989dbe..839bec1985 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-307-chip-defects.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-307-chip-defects.english.md @@ -27,7 +27,7 @@ Find p(20 000, 1 000 000) and give your answer rounded to 10 decimal places in t ```yml tests: - text: euler307() should return 0.7311720251. - testString: 'assert.strictEqual(euler307(), 0.7311720251, ''euler307() should return 0.7311720251.'');' + testString: 'assert.strictEqual(euler307(), 0.7311720251, "euler307() should return 0.7311720251.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-308-an-amazing-prime-generating-automaton.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-308-an-amazing-prime-generating-automaton.english.md index f23f7a3889..a642f01829 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-308-an-amazing-prime-generating-automaton.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-308-an-amazing-prime-generating-automaton.english.md @@ -58,7 +58,7 @@ If someone uses the above Fractran program to solve Project Euler Problem 7 (fin ```yml tests: - text: euler308() should return 1539669807660924. - testString: 'assert.strictEqual(euler308(), 1539669807660924, ''euler308() should return 1539669807660924.'');' + testString: 'assert.strictEqual(euler308(), 1539669807660924, "euler308() should return 1539669807660924.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-309-integer-ladders.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-309-integer-ladders.english.md index 3b3f323c77..4f45c86adb 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-309-integer-ladders.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-309-integer-ladders.english.md @@ -30,7 +30,7 @@ For integer values x, y, h and 0 < x < y < 1 000 000, how many triplets (x,y,h) ```yml tests: - text: euler309() should return 210139. - testString: 'assert.strictEqual(euler309(), 210139, ''euler309() should return 210139.'');' + testString: 'assert.strictEqual(euler309(), 210139, "euler309() should return 210139.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-31-coin-sums.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-31-coin-sums.english.md index c072c2f248..aa2a553117 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-31-coin-sums.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-31-coin-sums.english.md @@ -24,13 +24,13 @@ How many different ways can £(n) be made using any number of coins? ```yml tests: - text: coinSums(50) should return 451. - testString: 'assert(coinSums(50) == 451, ''coinSums(50) should return 451.'');' + testString: 'assert(coinSums(50) == 451, "coinSums(50) should return 451.");' - text: coinSums(100) should return 4563. - testString: 'assert(coinSums(100) == 4563, ''coinSums(100) should return 4563.'');' + testString: 'assert(coinSums(100) == 4563, "coinSums(100) should return 4563.");' - text: coinSums(150) should return 21873. - testString: 'assert(coinSums(150) == 21873, ''coinSums(150) should return 21873.'');' + testString: 'assert(coinSums(150) == 21873, "coinSums(150) should return 21873.");' - text: coinSums(200) should return 73682. - testString: 'assert(coinSums(200) == 73682, ''coinSums(200) should return 73682.'');' + testString: 'assert(coinSums(200) == 73682, "coinSums(200) should return 73682.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-310-nim-square.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-310-nim-square.english.md index 1152bfb675..18acd54937 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-310-nim-square.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-310-nim-square.english.md @@ -26,7 +26,7 @@ Find the number of losing positions for the next player if 0≤a≤b≤c≤100 0 ```yml tests: - text: euler310() should return 2586528661783. - testString: 'assert.strictEqual(euler310(), 2586528661783, ''euler310() should return 2586528661783.'');' + testString: 'assert.strictEqual(euler310(), 2586528661783, "euler310() should return 2586528661783.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-311-biclinic-integral-quadrilaterals.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-311-biclinic-integral-quadrilaterals.english.md index e1e538d52f..9ad1c4e31b 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-311-biclinic-integral-quadrilaterals.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-311-biclinic-integral-quadrilaterals.english.md @@ -34,7 +34,7 @@ Find B(10 000 000 000). ```yml tests: - text: euler311() should return 2466018557. - testString: 'assert.strictEqual(euler311(), 2466018557, ''euler311() should return 2466018557.'');' + testString: 'assert.strictEqual(euler311(), 2466018557, "euler311() should return 2466018557.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-312-cyclic-paths-on-sierpiski-graphs.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-312-cyclic-paths-on-sierpiski-graphs.english.md index 3c9d7f5a8f..2b288279cd 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-312-cyclic-paths-on-sierpiski-graphs.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-312-cyclic-paths-on-sierpiski-graphs.english.md @@ -38,7 +38,7 @@ Find C(C(C(10 000))) mod 138. ```yml tests: - text: euler312() should return 324681947. - testString: 'assert.strictEqual(euler312(), 324681947, ''euler312() should return 324681947.'');' + testString: 'assert.strictEqual(euler312(), 324681947, "euler312() should return 324681947.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-313-sliding-game.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-313-sliding-game.english.md index e0245b5826..304e975cd4 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-313-sliding-game.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-313-sliding-game.english.md @@ -30,7 +30,7 @@ How many grids does S(m,n) = p2, where p < 106 is prime? ```yml tests: - text: euler313() should return 2057774861813004. - testString: 'assert.strictEqual(euler313(), 2057774861813004, ''euler313() should return 2057774861813004.'');' + testString: 'assert.strictEqual(euler313(), 2057774861813004, "euler313() should return 2057774861813004.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-314-the-mouse-on-the-moon.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-314-the-mouse-on-the-moon.english.md index db6338446b..c661f1cd0b 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-314-the-mouse-on-the-moon.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-314-the-mouse-on-the-moon.english.md @@ -37,7 +37,7 @@ Give your answer rounded to 8 places behind the decimal point in the form abc.de ```yml tests: - text: euler314() should return 132.52756426. - testString: 'assert.strictEqual(euler314(), 132.52756426, ''euler314() should return 132.52756426.'');' + testString: 'assert.strictEqual(euler314(), 132.52756426, "euler314() should return 132.52756426.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-315-digital-root-clocks.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-315-digital-root-clocks.english.md index 0ddbc4533f..319353fe17 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-315-digital-root-clocks.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-315-digital-root-clocks.english.md @@ -41,7 +41,7 @@ For number 137, Max's clock requires:"137" "11" : 0 transitions (number "11" is already turned on correctly) -3 transitions (to turn off the first "1" and the bottom part of the second "1"; +3 transitions (to turn off the first "1" and the bottom part of the second "1"; the top part is common with number "2"). "2" : @@ -51,7 +51,7 @@ the top part is common with number "2"). For a grand total of 30 transitions. Of course, Max's clock consumes less power than Sam's one. -The two clocks are fed all the prime numbers between A = 107 and B = 2×107. +The two clocks are fed all the prime numbers between A = 107 and B = 2×107. Find the difference between the total number of transitions needed by Sam's clock and that needed by Max's one.
@@ -66,7 +66,7 @@ Find the difference between the total number of transitions needed by Sam's cloc ```yml tests: - text: euler315() should return 13625242. - testString: 'assert.strictEqual(euler315(), 13625242, ''euler315() should return 13625242.'');' + testString: 'assert.strictEqual(euler315(), 13625242, "euler315() should return 13625242.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-316-numbers-in-decimal-expansions.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-316-numbers-in-decimal-expansions.english.md index f8190b7407..18d9584c86 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-316-numbers-in-decimal-expansions.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-316-numbers-in-decimal-expansions.english.md @@ -7,7 +7,7 @@ title: 'Problem 316: Numbers in decimal expansions' ## Description
Let p = p1 p2 p3 ... be an infinite sequence of random digits, selected from {0,1,2,3,4,5,6,7,8,9} with equal probability. -It can be seen that p corresponds to the real number 0.p1 p2 p3 .... +It can be seen that p corresponds to the real number 0.p1 p2 p3 .... It can also be seen that choosing a random real number from the interval [0,1) is equivalent to choosing an infinite sequence of random digits selected from {0,1,2,3,4,5,6,7,8,9} with equal probability. For any positive integer n with d decimal digits, let k be the smallest index such that pk, pk+1, ...pk+d-1 are the decimal digits of n, in the same order. @@ -18,7 +18,7 @@ for p = 31415926535897...., we get k = 9 for p = 355287143650049560000490848764084685354..., we get k = 36 etc and we find that g(535) = 1008. -Given that , find +Given that , find Note: represents the floor function.
@@ -34,7 +34,7 @@ Note: represents the floor function. ```yml tests: - text: euler316() should return 542934735751917760. - testString: 'assert.strictEqual(euler316(), 542934735751917760, ''euler316() should return 542934735751917760.'');' + testString: 'assert.strictEqual(euler316(), 542934735751917760, "euler316() should return 542934735751917760.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-317-firecracker.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-317-firecracker.english.md index e8130a368d..33c8c7f466 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-317-firecracker.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-317-firecracker.english.md @@ -12,7 +12,7 @@ A firecracker explodes at a height of 100 m above level ground. It breaks into a We assume that the fragments move without air resistance, in a uniform gravitational field with g=9.81 m/s2. -Find the volume (in m3) of the region through which the fragments move before reaching the ground. +Find the volume (in m3) of the region through which the fragments move before reaching the ground. Give your answer rounded to four decimal places.
@@ -27,7 +27,7 @@ Give your answer rounded to four decimal places. ```yml tests: - text: euler317() should return 1856532.8455. - testString: 'assert.strictEqual(euler317(), 1856532.8455, ''euler317() should return 1856532.8455.'');' + testString: 'assert.strictEqual(euler317(), 1856532.8455, "euler317() should return 1856532.8455.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-318-2011-nines.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-318-2011-nines.english.md index 9bf98376ec..ede9570cf9 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-318-2011-nines.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-318-2011-nines.english.md @@ -22,7 +22,7 @@ It looks like that the number of consecutive nines at the beginning of the fract In fact it can be proven that the fractional part of (√2+√3)2n approaches 1 for large n. -Consider all real numbers of the form √p+√q with p and q positive integers and peuler318() should return 709313889. - testString: 'assert.strictEqual(euler318(), 709313889, ''euler318() should return 709313889.'');' + testString: 'assert.strictEqual(euler318(), 709313889, "euler318() should return 709313889.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-319-bounded-sequences.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-319-bounded-sequences.english.md index c6d94aa278..068ca7efbf 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-319-bounded-sequences.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-319-bounded-sequences.english.md @@ -35,7 +35,7 @@ Find t(1010) and give your answer modulo 109. ```yml tests: - text: euler319() should return 268457129. - testString: 'assert.strictEqual(euler319(), 268457129, ''euler319() should return 268457129.'');' + testString: 'assert.strictEqual(euler319(), 268457129, "euler319() should return 268457129.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-32-pandigital-products.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-32-pandigital-products.english.md index 395878eb95..3fed2904e7 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-32-pandigital-products.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-32-pandigital-products.english.md @@ -26,9 +26,9 @@ HINT: Some products can be obtained in more than one way so be sure to only incl ```yml tests: - text: pandigitalProducts() is a function. - testString: 'assert(typeof pandigitalProducts === ''function'', ''pandigitalProducts() is a function.'');' + testString: 'assert(typeof pandigitalProducts === "function", "pandigitalProducts() is a function.");' - text: pandigitalProducts() should return 45228. - testString: 'assert.strictEqual(pandigitalProducts(), 45228, ''pandigitalProducts() should return 45228.'');' + testString: 'assert.strictEqual(pandigitalProducts(), 45228, "pandigitalProducts() should return 45228.");' ``` @@ -75,7 +75,7 @@ function pandigitalProducts() { return true; } function concatenateNums(...numbers) { - let digitStr = ''; + let digitStr = "; for (let i = 0; i < numbers.length; i++) { digitStr += numbers[i].toString(); } diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-320-factorials-divisible-by-a-huge-integer.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-320-factorials-divisible-by-a-huge-integer.english.md index c696a136c2..d29f5146c7 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-320-factorials-divisible-by-a-huge-integer.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-320-factorials-divisible-by-a-huge-integer.english.md @@ -28,7 +28,7 @@ Find S(1 000 000) mod 1018. ```yml tests: - text: euler320() should return 278157919195482660. - testString: 'assert.strictEqual(euler320(), 278157919195482660, ''euler320() should return 278157919195482660.'');' + testString: 'assert.strictEqual(euler320(), 278157919195482660, "euler320() should return 278157919195482660.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-321-swapping-counters.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-321-swapping-counters.english.md index a61e513be1..cca5564593 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-321-swapping-counters.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-321-swapping-counters.english.md @@ -34,7 +34,7 @@ Find the sum of the first forty terms of this sequence. ```yml tests: - text: euler321() should return 2470433131948040. - testString: 'assert.strictEqual(euler321(), 2470433131948040, ''euler321() should return 2470433131948040.'');' + testString: 'assert.strictEqual(euler321(), 2470433131948040, "euler321() should return 2470433131948040.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-322-binomial-coefficients-divisible-by-10.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-322-binomial-coefficients-divisible-by-10.english.md index 9178854407..56cf231b55 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-322-binomial-coefficients-divisible-by-10.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-322-binomial-coefficients-divisible-by-10.english.md @@ -24,7 +24,7 @@ Find T(1018, 1012-10). ```yml tests: - text: euler322() should return 999998760323314000. - testString: 'assert.strictEqual(euler322(), 999998760323314000, ''euler322() should return 999998760323314000.'');' + testString: 'assert.strictEqual(euler322(), 999998760323314000, "euler322() should return 999998760323314000.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-323-bitwise-or-operations-on-random-integers.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-323-bitwise-or-operations-on-random-integers.english.md index 187dda6f85..041ecb981d 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-323-bitwise-or-operations-on-random-integers.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-323-bitwise-or-operations-on-random-integers.english.md @@ -12,7 +12,7 @@ For the sequence xi the following recursion is given:x0 = 0 and xi = xi-1| yi-1, for i > 0. ( | is the bitwise-OR operator) It can be seen that eventually there will be an index N such that xi = 232 -1 (a bit-pattern of all ones) for all i ≥ N. -Find the expected value of N. +Find the expected value of N. Give your answer rounded to 10 digits after the decimal point.
@@ -27,7 +27,7 @@ Give your answer rounded to 10 digits after the decimal point. ```yml tests: - text: euler323() should return 6.3551758451. - testString: 'assert.strictEqual(euler323(), 6.3551758451, ''euler323() should return 6.3551758451.'');' + testString: 'assert.strictEqual(euler323(), 6.3551758451, "euler323() should return 6.3551758451.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-324-building-a-tower.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-324-building-a-tower.english.md index 1663928308..ecdc8e88c8 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-324-building-a-tower.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-324-building-a-tower.english.md @@ -23,7 +23,7 @@ Find f(1010000) mod 100000007. ```yml tests: - text: euler324() should return 96972774. - testString: 'assert.strictEqual(euler324(), 96972774, ''euler324() should return 96972774.'');' + testString: 'assert.strictEqual(euler324(), 96972774, "euler324() should return 96972774.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-325-stone-game-ii.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-325-stone-game-ii.english.md index 2eb97cdc14..a2a36b6484 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-325-stone-game-ii.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-325-stone-game-ii.english.md @@ -44,7 +44,7 @@ Find S(1016) mod 710. ```yml tests: - text: euler325() should return 54672965. - testString: 'assert.strictEqual(euler325(), 54672965, ''euler325() should return 54672965.'');' + testString: 'assert.strictEqual(euler325(), 54672965, "euler325() should return 54672965.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-326-modulo-summations.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-326-modulo-summations.english.md index 880139e723..e38aae3130 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-326-modulo-summations.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-326-modulo-summations.english.md @@ -6,12 +6,12 @@ title: 'Problem 326: Modulo Summations' ## Description
-Let an be a sequence recursively defined by: . +Let an be a sequence recursively defined by: . So the first 10 elements of an are: 1,1,0,3,0,3,5,4,1,9. -Let f(N,M) represent the number of pairs (p,q) such that: +Let f(N,M) represent the number of pairs (p,q) such that: It can be seen that f(10,10)=4 with the pairs (3,3), (5,5), (7,9) and (9,10). @@ -33,7 +33,7 @@ Find f(1012,106). ```yml tests: - text: euler326() should return 1966666166408794400. - testString: 'assert.strictEqual(euler326(), 1966666166408794400, ''euler326() should return 1966666166408794400.'');' + testString: 'assert.strictEqual(euler326(), 1966666166408794400, "euler326() should return 1966666166408794400.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-327-rooms-of-doom.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-327-rooms-of-doom.english.md index a53674b908..f2960d4684 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-327-rooms-of-doom.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-327-rooms-of-doom.english.md @@ -41,7 +41,7 @@ Find ΣM(C,30) for 3 ≤ C ≤ 40. ```yml tests: - text: euler327() should return 34315549139516. - testString: 'assert.strictEqual(euler327(), 34315549139516, ''euler327() should return 34315549139516.'');' + testString: 'assert.strictEqual(euler327(), 34315549139516, "euler327() should return 34315549139516.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-328-lowest-cost-search.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-328-lowest-cost-search.english.md index 7f03a009d1..219769dd79 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-328-lowest-cost-search.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-328-lowest-cost-search.english.md @@ -6,7 +6,7 @@ title: 'Problem 328: Lowest-cost Search' ## Description
-We are trying to find a hidden number selected from the set of integers {1, 2, ..., n} by asking questions. +We are trying to find a hidden number selected from the set of integers {1, 2, ..., n} by asking questions. Each number (question) we ask, has a cost equal to the number asked and we get one of three possible answers: "Your guess is lower than the hidden number", or "Yes, that's it!", or "Your guess is higher than the hidden number". @@ -42,7 +42,7 @@ Find C(n). ```yml tests: - text: euler328() should return 260511850222. - testString: 'assert.strictEqual(euler328(), 260511850222, ''euler328() should return 260511850222.'');' + testString: 'assert.strictEqual(euler328(), 260511850222, "euler328() should return 260511850222.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-329-prime-frog.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-329-prime-frog.english.md index 1e685eb6a3..da37855388 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-329-prime-frog.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-329-prime-frog.english.md @@ -31,7 +31,7 @@ Give your answer as a fraction p/q in reduced form. ```yml tests: - text: euler329() should return 199740353 / 29386561536000. - testString: 'assert.strictEqual(euler329(), 199740353 / 29386561536000, ''euler329() should return 199740353 / 29386561536000.'');' + testString: 'assert.strictEqual(euler329(), 199740353 / 29386561536000, "euler329() should return 199740353 / 29386561536000.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-33-digit-cancelling-fractions.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-33-digit-cancelling-fractions.english.md index 1d5e43694a..78c94c02bd 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-33-digit-cancelling-fractions.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-33-digit-cancelling-fractions.english.md @@ -23,7 +23,7 @@ If the product of these four fractions is given in its lowest common terms, find ```yml tests: - text: digitCancellingFractions() should return 100. - testString: 'assert.strictEqual(digitCancellingFractions(), 100, ''digitCancellingFractions() should return 100.'');' + testString: 'assert.strictEqual(digitCancellingFractions(), 100, "digitCancellingFractions() should return 100.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-330-eulers-number.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-330-eulers-number.english.md index 903d240437..a821fd15ef 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-330-eulers-number.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-330-eulers-number.english.md @@ -1,7 +1,7 @@ --- id: 5900f4b71000cf542c50ffc9 challengeType: 5 -title: 'Problem 330: Euler''s Number' +title: 'Problem 330: Euler"s Number' --- ## Description @@ -9,21 +9,21 @@ title: 'Problem 330: Euler''s Number' An infinite sequence of real numbers a(n) is defined for all integers n as follows: -For example,a(0) = +For example,a(0) = 11! + 12! + 13! - + ... = e − 1 -a(1) = + + ... = e − 1 +a(1) = e − 11! + 12! + 13! - + ... = 2e − 3 -a(2) = + + ... = 2e − 3 +a(2) = 2e − 31! + e − 12! @@ -31,17 +31,17 @@ a(2) = 13! + ... = 72 - e − 6 + e − 6 with e = 2.7182818... being Euler's constant. -It can be shown that a(n) is of the form +It can be shown that a(n) is of the form A(n) e + B(n)n! - for integers A(n) and B(n). + for integers A(n) and B(n). -For example a(10) = +For example a(10) = 328161643 e − 65269448610! . @@ -60,7 +60,7 @@ Find A(109) + B(109) and give your answer mod 77 777 777. ```yml tests: - text: euler330() should return 15955822. - testString: 'assert.strictEqual(euler330(), 15955822, ''euler330() should return 15955822.'');' + testString: 'assert.strictEqual(euler330(), 15955822, "euler330() should return 15955822.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-331-cross-flips.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-331-cross-flips.english.md index 8d388cb56e..9c0fad77dd 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-331-cross-flips.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-331-cross-flips.english.md @@ -15,7 +15,7 @@ At each turn, you may choose a disk and flip all the disks in the same row and t It can be proven that 3 is the minimal number of turns to finish this game. The bottom left disk on the N×N board has coordinates (0,0); -the bottom right disk has coordinates (N-1,0) and the top left disk has coordinates (0,N-1). +the bottom right disk has coordinates (N-1,0) and the top left disk has coordinates (0,N-1). Let CN be the following configuration of a board with N×N disks: A disk at (x,y) satisfying , shows its black side; otherwise, it shows its white side. C5 is shown above. @@ -37,7 +37,7 @@ Find . ```yml tests: - text: euler331() should return 467178235146843500. - testString: 'assert.strictEqual(euler331(), 467178235146843500, ''euler331() should return 467178235146843500.'');' + testString: 'assert.strictEqual(euler331(), 467178235146843500, "euler331() should return 467178235146843500.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-332-spherical-triangles.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-332-spherical-triangles.english.md index 36e5687949..2971f3adb9 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-332-spherical-triangles.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-332-spherical-triangles.english.md @@ -33,7 +33,7 @@ Find A(r). Give your answer rounded to six decimal places. ```yml tests: - text: euler332() should return 2717.751525. - testString: 'assert.strictEqual(euler332(), 2717.751525, ''euler332() should return 2717.751525.'');' + testString: 'assert.strictEqual(euler332(), 2717.751525, "euler332() should return 2717.751525.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-333-special-partitions.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-333-special-partitions.english.md index a01e4f5805..aff2c20ac6 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-333-special-partitions.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-333-special-partitions.english.md @@ -35,7 +35,7 @@ Find the sum of the primes q <1000000 such that P(q)=1. ```yml tests: - text: euler333() should return 3053105. - testString: 'assert.strictEqual(euler333(), 3053105, ''euler333() should return 3053105.'');' + testString: 'assert.strictEqual(euler333(), 3053105, "euler333() should return 3053105.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-334-spilling-the-beans.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-334-spilling-the-beans.english.md index 814c2fa60a..e3765926db 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-334-spilling-the-beans.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-334-spilling-the-beans.english.md @@ -18,7 +18,7 @@ You are given the following sequences: t0 = 123456. - ti = + ti = @@ -38,7 +38,7 @@ You are given the following sequences: - 926252, + 926252, if ti-1 is odd @@ -74,7 +74,7 @@ Consider now 1500 adjacent bowls containing b1, b2,..., b1500 beans respectively ```yml tests: - text: euler334() should return 150320021261690850. - testString: 'assert.strictEqual(euler334(), 150320021261690850, ''euler334() should return 150320021261690850.'');' + testString: 'assert.strictEqual(euler334(), 150320021261690850, "euler334() should return 150320021261690850.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-335-gathering-the-beans.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-335-gathering-the-beans.english.md index 1e77de15ad..4278dcf636 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-335-gathering-the-beans.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-335-gathering-the-beans.english.md @@ -28,7 +28,7 @@ Find M(2k+1). Give your answer modulo 79. ```yml tests: - text: euler335() should return 5032316. - testString: 'assert.strictEqual(euler335(), 5032316, ''euler335() should return 5032316.'');' + testString: 'assert.strictEqual(euler335(), 5032316, "euler335() should return 5032316.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-336-maximix-arrangements.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-336-maximix-arrangements.english.md index 671dd1150f..c6866f41f2 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-336-maximix-arrangements.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-336-maximix-arrangements.english.md @@ -6,7 +6,7 @@ title: 'Problem 336: Maximix Arrangements' ## Description
-A train is used to transport four carriages in the order: ABCD. However, sometimes when the train arrives to collect the carriages they are not in the correct order. +A train is used to transport four carriages in the order: ABCD. However, sometimes when the train arrives to collect the carriages they are not in the correct order. To rearrange the carriages they are all shunted on to a large rotating turntable. After the carriages are uncoupled at a specific point the train moves off the turntable pulling the carriages still attached with it. The remaining carriages are rotated 180 degrees. All of the carriages are then rejoined and this process is repeated as often as necessary in order to obtain the least number of uses of the turntable. Some arrangements, such as ADCB, can be solved easily: the carriages are separated between A and D, and after DCB are rotated the correct order has been achieved. @@ -33,7 +33,7 @@ Find the 2011th lexicographic maximix arrangement for eleven carriages. ```yml tests: - text: euler336() should return CAGBIHEFJDK. - testString: 'assert.strictEqual(euler336(), CAGBIHEFJDK, ''euler336() should return CAGBIHEFJDK.'');' + testString: 'assert.strictEqual(euler336(), CAGBIHEFJDK, "euler336() should return CAGBIHEFJDK.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-337-totient-stairstep-sequences.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-337-totient-stairstep-sequences.english.md index 93b7700279..03cbdd17ab 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-337-totient-stairstep-sequences.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-337-totient-stairstep-sequences.english.md @@ -29,7 +29,7 @@ Find S(20 000 000) mod 108. ```yml tests: - text: euler337() should return 85068035. - testString: 'assert.strictEqual(euler337(), 85068035, ''euler337() should return 85068035.'');' + testString: 'assert.strictEqual(euler337(), 85068035, "euler337() should return 85068035.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-338-cutting-rectangular-grid-paper.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-338-cutting-rectangular-grid-paper.english.md index 5936015f89..25e67c338d 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-338-cutting-rectangular-grid-paper.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-338-cutting-rectangular-grid-paper.english.md @@ -16,7 +16,7 @@ For example, from a sheet with dimensions 9 × 4 , we can make rectangles with d Similarly, from a sheet with dimensions 9 × 8 , we can make rectangles with dimensions 18 × 4 and 12 × 6 . For a pair w and h, let F(w,h) be the number of distinct rectangles that can be made from a sheet with dimensions w × h . -For example, F(2,1) = 0, F(2,2) = 1, F(9,4) = 3 and F(9,8) = 2. +For example, F(2,1) = 0, F(2,2) = 1, F(9,4) = 3 and F(9,8) = 2. Note that rectangles congruent to the initial one are not counted in F(w,h). Note also that rectangles with dimensions w × h and dimensions h × w are not considered distinct. @@ -37,7 +37,7 @@ Find G(1012). Give your answer modulo 108. ```yml tests: - text: euler338() should return 15614292. - testString: 'assert.strictEqual(euler338(), 15614292, ''euler338() should return 15614292.'');' + testString: 'assert.strictEqual(euler338(), 15614292, "euler338() should return 15614292.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-339-peredur-fab-efrawg.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-339-peredur-fab-efrawg.english.md index ed82dd8e44..2cfea712de 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-339-peredur-fab-efrawg.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-339-peredur-fab-efrawg.english.md @@ -29,7 +29,7 @@ Find E(10 000) and give your answer rounded to 6 places behind the decimal point ```yml tests: - text: euler339() should return 19823.542204. - testString: 'assert.strictEqual(euler339(), 19823.542204, ''euler339() should return 19823.542204.'');' + testString: 'assert.strictEqual(euler339(), 19823.542204, "euler339() should return 19823.542204.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-34-digit-factorials.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-34-digit-factorials.english.md index d64b472bfa..b4acc1019d 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-34-digit-factorials.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-34-digit-factorials.english.md @@ -22,7 +22,7 @@ Note: as 1! = 1 and 2! = 2 are not sums they are not included. ```yml tests: - text: 'digitFactorial() should return { sum: 40730, numbers: [145, 40585] }.' - testString: 'assert.deepEqual(digitFactorial(), { sum: 40730, numbers: [145, 40585] }, ''digitFactorial() should return { sum: 40730, numbers: [145, 40585] }.'');' + testString: 'assert.deepEqual(digitFactorial(), { sum: 40730, numbers: [145, 40585] }, "digitFactorial() should return { sum: 40730, numbers: [145, 40585] }.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-340-crazy-function.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-340-crazy-function.english.md index 2ee1f11400..91451aa4c3 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-340-crazy-function.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-340-crazy-function.english.md @@ -7,7 +7,7 @@ title: 'Problem 340: Crazy Function' ## Description
For fixed integers a, b, c, define the crazy function F(n) as follows: -F(n) = n - c for all n > b +F(n) = n - c for all n > b F(n) = F(a + F(a + F(a + F(a + n)))) for all n ≤ b. @@ -32,7 +32,7 @@ Find the last 9 digits of S(217, 721, 127). ```yml tests: - text: euler340() should return 291504964. - testString: 'assert.strictEqual(euler340(), 291504964, ''euler340() should return 291504964.'');' + testString: 'assert.strictEqual(euler340(), 291504964, "euler340() should return 291504964.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-341-golombs-self-describing-sequence.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-341-golombs-self-describing-sequence.english.md index b56d7e7887..04ee14cb16 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-341-golombs-self-describing-sequence.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-341-golombs-self-describing-sequence.english.md @@ -1,7 +1,7 @@ --- id: 5900f4c11000cf542c50ffd3 challengeType: 5 -title: 'Problem 341: Golomb''s self-describing sequence' +title: 'Problem 341: Golomb"s self-describing sequence' --- ## Description @@ -28,7 +28,7 @@ Find ΣG(n3) for 1 ≤ n < 106. ```yml tests: - text: euler341() should return 56098610614277016. - testString: 'assert.strictEqual(euler341(), 56098610614277016, ''euler341() should return 56098610614277016.'');' + testString: 'assert.strictEqual(euler341(), 56098610614277016, "euler341() should return 56098610614277016.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-342-the-totient-of-a-square-is-a-cube.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-342-the-totient-of-a-square-is-a-cube.english.md index d30b0f6a63..0f6fba96ae 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-342-the-totient-of-a-square-is-a-cube.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-342-the-totient-of-a-square-is-a-cube.english.md @@ -28,7 +28,7 @@ Find the sum of all numbers n, 1 < n < 1010 such that φ(n2) is a cube. ```yml tests: - text: euler342() should return 5943040885644. - testString: 'assert.strictEqual(euler342(), 5943040885644, ''euler342() should return 5943040885644.'');' + testString: 'assert.strictEqual(euler342(), 5943040885644, "euler342() should return 5943040885644.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-343-fractional-sequences.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-343-fractional-sequences.english.md index 736991cb53..1c57f4b924 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-343-fractional-sequences.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-343-fractional-sequences.english.md @@ -10,7 +10,7 @@ For any positive integer k, a finite sequence ai of fractions xi/yi is defined b a1 = 1/k and ai = (xi-1+1)/(yi-1-1) reduced to lowest terms for i>1. When ai reaches some integer n, the sequence stops. (That is, when yi=1.) -Define f(k) = n. +Define f(k) = n. For example, for k = 20: @@ -41,7 +41,7 @@ Find Σf(k3) for 1 ≤ k ≤ 2×106. ```yml tests: - text: euler343() should return 269533451410884200. - testString: 'assert.strictEqual(euler343(), 269533451410884200, ''euler343() should return 269533451410884200.'');' + testString: 'assert.strictEqual(euler343(), 269533451410884200, "euler343() should return 269533451410884200.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-344-silver-dollar-game.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-344-silver-dollar-game.english.md index 460d465a0e..5e6394f013 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-344-silver-dollar-game.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-344-silver-dollar-game.english.md @@ -40,7 +40,7 @@ Find W(1 000 000, 100) modulo the semiprime 1000 036 000 099 (= 1 000 003 · 1 0 ```yml tests: - text: euler344() should return 65579304332. - testString: 'assert.strictEqual(euler344(), 65579304332, ''euler344() should return 65579304332.'');' + testString: 'assert.strictEqual(euler344(), 65579304332, "euler344() should return 65579304332.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-345-matrix-sum.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-345-matrix-sum.english.md index 03c71cb337..7277bad6b2 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-345-matrix-sum.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-345-matrix-sum.english.md @@ -45,7 +45,7 @@ Find the Matrix Sum of: ```yml tests: - text: euler345() should return 13938. - testString: 'assert.strictEqual(euler345(), 13938, ''euler345() should return 13938.'');' + testString: 'assert.strictEqual(euler345(), 13938, "euler345() should return 13938.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-346-strong-repunits.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-346-strong-repunits.english.md index 9365aff233..4ee41da49b 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-346-strong-repunits.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-346-strong-repunits.english.md @@ -6,7 +6,7 @@ title: 'Problem 346: Strong Repunits' ## Description
-The number 7 is special, because 7 is 111 written in base 2, and 11 written in base 6 (i.e. 710 = 116 = 1112). In other words, 7 is a repunit in at least two bases b > 1. +The number 7 is special, because 7 is 111 written in base 2, and 11 written in base 6 (i.e. 710 = 116 = 1112). In other words, 7 is a repunit in at least two bases b > 1. We shall call a positive integer with this property a strong repunit. It can be verified that there are 8 strong repunits below 50: {1,7,13,15,21,31,40,43}. Furthermore, the sum of all strong repunits below 1000 equals 15864. @@ -25,7 +25,7 @@ Find the sum of all strong repunits below 1012. ```yml tests: - text: euler346() should return 336108797689259260. - testString: 'assert.strictEqual(euler346(), 336108797689259260, ''euler346() should return 336108797689259260.'');' + testString: 'assert.strictEqual(euler346(), 336108797689259260, "euler346() should return 336108797689259260.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-347-largest-integer-divisible-by-two-primes.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-347-largest-integer-divisible-by-two-primes.english.md index ea4bfbe12f..a60140b6f4 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-347-largest-integer-divisible-by-two-primes.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-347-largest-integer-divisible-by-two-primes.english.md @@ -11,7 +11,7 @@ For two distinct primes p and q let M(p,q,N) be the largest positive integer ≤ by both p and q and M(p,q,N)=0 if such a positive integer does not exist. -E.g. M(2,3,100)=96. +E.g. M(2,3,100)=96. M(3,5,100)=75 and not 90 because 90 is divisible by 2 ,3 and 5. Also M(2,73,100)=0 because there does not exist a positive integer ≤ 100 that is divisible by both 2 and 73. @@ -34,7 +34,7 @@ Find S(10 000 000). ```yml tests: - text: euler347() should return 11109800204052. - testString: 'assert.strictEqual(euler347(), 11109800204052, ''euler347() should return 11109800204052.'');' + testString: 'assert.strictEqual(euler347(), 11109800204052, "euler347() should return 11109800204052.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-348-sum-of-a-square-and-a-cube.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-348-sum-of-a-square-and-a-cube.english.md index 76f23a5d5e..655554c78d 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-348-sum-of-a-square-and-a-cube.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-348-sum-of-a-square-and-a-cube.english.md @@ -29,7 +29,7 @@ Find the sum of the five smallest such palindromic numbers. ```yml tests: - text: euler348() should return 1004195061. - testString: 'assert.strictEqual(euler348(), 1004195061, ''euler348() should return 1004195061.'');' + testString: 'assert.strictEqual(euler348(), 1004195061, "euler348() should return 1004195061.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-349-langtons-ant.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-349-langtons-ant.english.md index 4b4913234c..1e4ced9d2d 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-349-langtons-ant.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-349-langtons-ant.english.md @@ -1,12 +1,12 @@ --- id: 5900f4ca1000cf542c50ffdc challengeType: 5 -title: 'Problem 349: Langton''s ant' +title: 'Problem 349: Langton"s ant' --- ## Description
-An ant moves on a regular grid of squares that are coloured either black or white. +An ant moves on a regular grid of squares that are coloured either black or white. The ant is always oriented in one of the cardinal directions (left, right, up or down) and moves from square to adjacent square according to the following rules: - if it is on a black square, it flips the color of the square to white, rotates 90 degrees counterclockwise and moves forward one square. - if it is on a white square, it flips the color of the square to black, rotates 90 degrees clockwise and moves forward one square. @@ -25,7 +25,7 @@ Starting with a grid that is entirely white, how many squares are black after 10 ```yml tests: - text: euler349() should return 115384615384614940. - testString: 'assert.strictEqual(euler349(), 115384615384614940, ''euler349() should return 115384615384614940.'');' + testString: 'assert.strictEqual(euler349(), 115384615384614940, "euler349() should return 115384615384614940.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-35-circular-primes.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-35-circular-primes.english.md index c041c0f20a..3b03e11ff6 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-35-circular-primes.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-35-circular-primes.english.md @@ -22,17 +22,17 @@ How many circular primes are there below n, whereas 100 <= n <= 1000000? ```yml tests: - text: circularPrimes(100) should return 13. - testString: 'assert(circularPrimes(100) == 13, ''circularPrimes(100) should return 13.'');' + testString: 'assert(circularPrimes(100) == 13, "circularPrimes(100) should return 13.");' - text: circularPrimes(100000) should return 43. - testString: 'assert(circularPrimes(100000) == 43, ''circularPrimes(100000) should return 43.'');' + testString: 'assert(circularPrimes(100000) == 43, "circularPrimes(100000) should return 43.");' - text: circularPrimes(250000) should return 45. - testString: 'assert(circularPrimes(250000) == 45, ''circularPrimes(250000) should return 45.'');' + testString: 'assert(circularPrimes(250000) == 45, "circularPrimes(250000) should return 45.");' - text: circularPrimes(500000) should return 49. - testString: 'assert(circularPrimes(500000) == 49, ''circularPrimes(500000) should return 49.'');' + testString: 'assert(circularPrimes(500000) == 49, "circularPrimes(500000) should return 49.");' - text: circularPrimes(750000) should return 49. - testString: 'assert(circularPrimes(750000) == 49, ''circularPrimes(750000) should return 49.'');' + testString: 'assert(circularPrimes(750000) == 49, "circularPrimes(750000) should return 49.");' - text: circularPrimes(1000000) should return 55. - testString: 'assert(circularPrimes(1000000) == 55, ''circularPrimes(1000000) should return 55.'');' + testString: 'assert(circularPrimes(1000000) == 55, "circularPrimes(1000000) should return 55.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-350-constraining-the-least-greatest-and-the-greatest-least.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-350-constraining-the-least-greatest-and-the-greatest-least.english.md index ec63383b26..df41d4f853 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-350-constraining-the-least-greatest-and-the-greatest-least.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-350-constraining-the-least-greatest-and-the-greatest-least.english.md @@ -33,7 +33,7 @@ Find f(106, 1012, 1018) mod 1014. ```yml tests: - text: euler350() should return 84664213. - testString: 'assert.strictEqual(euler350(), 84664213, ''euler350() should return 84664213.'');' + testString: 'assert.strictEqual(euler350(), 84664213, "euler350() should return 84664213.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-351-hexagonal-orchards.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-351-hexagonal-orchards.english.md index eb23de6eef..1933d31425 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-351-hexagonal-orchards.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-351-hexagonal-orchards.english.md @@ -39,7 +39,7 @@ Find H(100 000 000). ```yml tests: - text: euler351() should return 11762187201804552. - testString: 'assert.strictEqual(euler351(), 11762187201804552, ''euler351() should return 11762187201804552.'');' + testString: 'assert.strictEqual(euler351(), 11762187201804552, "euler351() should return 11762187201804552.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-352-blood-tests.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-352-blood-tests.english.md index 003238e555..07c531e56e 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-352-blood-tests.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-352-blood-tests.english.md @@ -12,7 +12,7 @@ An accurate and extremely sensitive PCR test exists for blood samples, producing Because of the high cost, the vet-in-charge suggests that instead of performing 25 separate tests, the following procedure can be used instead: -The sheep are split into 5 groups of 5 sheep in each group. +The sheep are split into 5 groups of 5 sheep in each group. For each group, the 5 samples are mixed together and a single test is performed. Then, If the result is negative, all the sheep in that group are deemed to be virus-free. If the result is positive, 5 additional tests will be performed (a separate test for each animal) to determine the affected individual(s). @@ -57,7 +57,7 @@ Give your answer rounded to six decimal places. ```yml tests: - text: euler352() should return 378563.260589. - testString: 'assert.strictEqual(euler352(), 378563.260589, ''euler352() should return 378563.260589.'');' + testString: 'assert.strictEqual(euler352(), 378563.260589, "euler352() should return 378563.260589.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-353-risky-moon.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-353-risky-moon.english.md index cdfd490573..5cc198f5e4 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-353-risky-moon.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-353-risky-moon.english.md @@ -6,7 +6,7 @@ title: 'Problem 353: Risky moon' ## Description
-A moon could be described by the sphere C(r) with centre (0,0,0) and radius r. +A moon could be described by the sphere C(r) with centre (0,0,0) and radius r. @@ -26,7 +26,7 @@ The minimal risk of a journey from the North Pole station to the South Pole stat -You are given that M(7)=0.1784943998 rounded to 10 digits behind the decimal point. +You are given that M(7)=0.1784943998 rounded to 10 digits behind the decimal point. @@ -48,7 +48,7 @@ Give your answer rounded to 10 digits behind the decimal point in the form a.bcd ```yml tests: - text: euler353() should return 1.2759860331. - testString: 'assert.strictEqual(euler353(), 1.2759860331, ''euler353() should return 1.2759860331.'');' + testString: 'assert.strictEqual(euler353(), 1.2759860331, "euler353() should return 1.2759860331.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-354-distances-in-a-bees-honeycomb.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-354-distances-in-a-bees-honeycomb.english.md index 0b561b1ba0..a86c01cb49 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-354-distances-in-a-bees-honeycomb.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-354-distances-in-a-bees-honeycomb.english.md @@ -1,7 +1,7 @@ --- id: 5900f4cf1000cf542c50ffe1 challengeType: 5 -title: 'Problem 354: Distances in a bee''s honeycomb' +title: 'Problem 354: Distances in a bee"s honeycomb' --- ## Description @@ -14,7 +14,7 @@ Consider a honey bee's honeycomb where each cell is a perfect regular hexagon wi One particular cell is occupied by the queen bee. -For a positive real number L, let B(L) count the cells with distance L from the queen bee cell (all distances are measured from centre to centre); you may assume that the honeycomb is large enough to accommodate for any distance we wish to consider. +For a positive real number L, let B(L) count the cells with distance L from the queen bee cell (all distances are measured from centre to centre); you may assume that the honeycomb is large enough to accommodate for any distance we wish to consider. For example, B(√3) = 6, B(√21) = 12 and B(111 111 111) = 54. Find the number of L ≤ 5·1011 such that B(L) = 450. @@ -31,7 +31,7 @@ Find the number of L ≤ 5·1011 such that B(L) = 450. ```yml tests: - text: euler354() should return 58065134. - testString: 'assert.strictEqual(euler354(), 58065134, ''euler354() should return 58065134.'');' + testString: 'assert.strictEqual(euler354(), 58065134, "euler354() should return 58065134.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-355-maximal-coprime-subset.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-355-maximal-coprime-subset.english.md index d3562c625b..2278933967 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-355-maximal-coprime-subset.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-355-maximal-coprime-subset.english.md @@ -10,7 +10,7 @@ Define Co(n) to be the maximal possible sum of a set of mutually co-prime elemen -You are given that Co(30) = 193 and Co(100) = 1356. +You are given that Co(30) = 193 and Co(100) = 1356. Find Co(200000). @@ -27,7 +27,7 @@ Find Co(200000). ```yml tests: - text: euler355() should return 1726545007. - testString: 'assert.strictEqual(euler355(), 1726545007, ''euler355() should return 1726545007.'');' + testString: 'assert.strictEqual(euler355(), 1726545007, "euler355() should return 1726545007.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-356-largest-roots-of-cubic-polynomials.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-356-largest-roots-of-cubic-polynomials.english.md index 79ffc9c443..3543fe9da4 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-356-largest-roots-of-cubic-polynomials.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-356-largest-roots-of-cubic-polynomials.english.md @@ -27,7 +27,7 @@ Note: represents the floor function. ```yml tests: - text: euler356() should return 28010159. - testString: 'assert.strictEqual(euler356(), 28010159, ''euler356() should return 28010159.'');' + testString: 'assert.strictEqual(euler356(), 28010159, "euler356() should return 28010159.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-357-prime-generating-integers.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-357-prime-generating-integers.english.md index 8009e8c45b..0fcfabfd19 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-357-prime-generating-integers.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-357-prime-generating-integers.english.md @@ -25,7 +25,7 @@ for every divisor d of n, d+n/d is prime. ```yml tests: - text: euler357() should return 1739023853137. - testString: 'assert.strictEqual(euler357(), 1739023853137, ''euler357() should return 1739023853137.'');' + testString: 'assert.strictEqual(euler357(), 1739023853137, "euler357() should return 1739023853137.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-358-cyclic-numbers.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-358-cyclic-numbers.english.md index 441e980658..ad54118511 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-358-cyclic-numbers.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-358-cyclic-numbers.english.md @@ -17,7 +17,7 @@ The smallest cyclic number is the 6-digit number 142857 : 142857 × 3 = 428571 142857 × 4 = 571428 142857 × 5 = 714285 -142857 × 6 = 857142 +142857 × 6 = 857142 @@ -48,7 +48,7 @@ There is only one cyclic number for which, the eleven leftmost digits are 000000 ```yml tests: - text: euler358() should return 3284144505. - testString: 'assert.strictEqual(euler358(), 3284144505, ''euler358() should return 3284144505.'');' + testString: 'assert.strictEqual(euler358(), 3284144505, "euler358() should return 3284144505.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-359-hilberts-new-hotel.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-359-hilberts-new-hotel.english.md index 1aac536d24..6245a844fb 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-359-hilberts-new-hotel.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-359-hilberts-new-hotel.english.md @@ -1,12 +1,12 @@ --- id: 5900f4d31000cf542c50ffe6 challengeType: 5 -title: 'Problem 359: Hilbert''s New Hotel' +title: 'Problem 359: Hilbert"s New Hotel' --- ## Description
-An infinite number of people (numbered 1, 2, 3, etc.) are lined up to get a room at Hilbert's newest infinite hotel. The hotel contains an infinite number of floors (numbered 1, 2, 3, etc.), and each floor contains an infinite number of rooms (numbered 1, 2, 3, etc.). +An infinite number of people (numbered 1, 2, 3, etc.) are lined up to get a room at Hilbert's newest infinite hotel. The hotel contains an infinite number of floors (numbered 1, 2, 3, etc.), and each floor contains an infinite number of rooms (numbered 1, 2, 3, etc.). @@ -49,7 +49,7 @@ Find the sum of all P(f, r) for all positive f and r such that f × r = 71328803 ```yml tests: - text: euler359() should return 40632119. - testString: 'assert.strictEqual(euler359(), 40632119, ''euler359() should return 40632119.'');' + testString: 'assert.strictEqual(euler359(), 40632119, "euler359() should return 40632119.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-36-double-base-palindromes.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-36-double-base-palindromes.english.md index b0be7abce6..27572923a4 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-36-double-base-palindromes.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-36-double-base-palindromes.english.md @@ -22,13 +22,13 @@ Find the sum of all numbers, less than n, whereas 1000 <= n <= 1000000, which ar ```yml tests: - text: doubleBasePalindromes(1000) should return 1772. - testString: 'assert(doubleBasePalindromes(1000) == 1772, ''doubleBasePalindromes(1000) should return 1772.'');' + testString: 'assert(doubleBasePalindromes(1000) == 1772, "doubleBasePalindromes(1000) should return 1772.");' - text: doubleBasePalindromes(50000) should return 105795. - testString: 'assert(doubleBasePalindromes(50000) == 105795, ''doubleBasePalindromes(50000) should return 105795.'');' + testString: 'assert(doubleBasePalindromes(50000) == 105795, "doubleBasePalindromes(50000) should return 105795.");' - text: doubleBasePalindromes(500000) should return 286602. - testString: 'assert(doubleBasePalindromes(500000) == 286602, ''doubleBasePalindromes(500000) should return 286602.'');' + testString: 'assert(doubleBasePalindromes(500000) == 286602, "doubleBasePalindromes(500000) should return 286602.");' - text: doubleBasePalindromes(1000000) should return 872187. - testString: 'assert(doubleBasePalindromes(1000000) == 872187, ''doubleBasePalindromes(1000000) should return 872187.'');' + testString: 'assert(doubleBasePalindromes(1000000) == 872187, "doubleBasePalindromes(1000000) should return 872187.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-360-scary-sphere.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-360-scary-sphere.english.md index fe1c3390f4..5d51ad5ce1 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-360-scary-sphere.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-360-scary-sphere.english.md @@ -31,7 +31,7 @@ Find S(1010). ```yml tests: - text: euler360() should return 878825614395267100. - testString: 'assert.strictEqual(euler360(), 878825614395267100, ''euler360() should return 878825614395267100.'');' + testString: 'assert.strictEqual(euler360(), 878825614395267100, "euler360() should return 878825614395267100.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-361-subsequence-of-thue-morse-sequence.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-361-subsequence-of-thue-morse-sequence.english.md index c5bd6163ff..1ef64817e6 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-361-subsequence-of-thue-morse-sequence.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-361-subsequence-of-thue-morse-sequence.english.md @@ -45,7 +45,7 @@ Find the last 9 digits of . ```yml tests: - text: euler361() should return 178476944. - testString: 'assert.strictEqual(euler361(), 178476944, ''euler361() should return 178476944.'');' + testString: 'assert.strictEqual(euler361(), 178476944, "euler361() should return 178476944.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-362-squarefree-factors.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-362-squarefree-factors.english.md index d2fa50ed92..fa4bbea1a9 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-362-squarefree-factors.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-362-squarefree-factors.english.md @@ -36,7 +36,7 @@ Find S(10 000 000 000). ```yml tests: - text: euler362() should return 457895958010. - testString: 'assert.strictEqual(euler362(), 457895958010, ''euler362() should return 457895958010.'');' + testString: 'assert.strictEqual(euler362(), 457895958010, "euler362() should return 457895958010.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-363-bzier-curves.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-363-bzier-curves.english.md index 5b780ffe4c..9205696161 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-363-bzier-curves.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-363-bzier-curves.english.md @@ -41,7 +41,7 @@ That is, if L is the length of the curve, calculate 100 × L − π/2π/2Give y ```yml tests: - text: euler363() should return 0.0000372091. - testString: 'assert.strictEqual(euler363(), 0.0000372091, ''euler363() should return 0.0000372091.'');' + testString: 'assert.strictEqual(euler363(), 0.0000372091, "euler363() should return 0.0000372091.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-364-comfortable-distance.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-364-comfortable-distance.english.md index 99a5df5f0a..37f2a534e3 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-364-comfortable-distance.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-364-comfortable-distance.english.md @@ -9,7 +9,7 @@ title: 'Problem 364: Comfortable distance' There are N seats in a row. N people come after each other to fill the seats according to the following rules: If there is any seat whose adjacent seat(s) are not occupied take such a seat. If there is no such seat and there is any seat for which only one adjacent seat is occupied take such a seat. -Otherwise take one of the remaining available seats. +Otherwise take one of the remaining available seats. Let T(N) be the number of possibilities that N seats are occupied by N people with the given rules. The following figure shows T(4)=8. @@ -32,7 +32,7 @@ Find T(1 000 000) mod 100 000 007. ```yml tests: - text: euler364() should return 44855254. - testString: 'assert.strictEqual(euler364(), 44855254, ''euler364() should return 44855254.'');' + testString: 'assert.strictEqual(euler364(), 44855254, "euler364() should return 44855254.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-365-a-huge-binomial-coefficient.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-365-a-huge-binomial-coefficient.english.md index 42b3c62a43..0f248b404f 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-365-a-huge-binomial-coefficient.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-365-a-huge-binomial-coefficient.english.md @@ -26,7 +26,7 @@ Calculate ∑M(1018,109,p*q*r) for 1000euler365() should return 162619462356610300. - testString: 'assert.strictEqual(euler365(), 162619462356610300, ''euler365() should return 162619462356610300.'');' + testString: 'assert.strictEqual(euler365(), 162619462356610300, "euler365() should return 162619462356610300.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-366-stone-game-iii.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-366-stone-game-iii.english.md index e729056206..fa075907b9 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-366-stone-game-iii.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-366-stone-game-iii.english.md @@ -43,7 +43,7 @@ Give your answer modulo 108. ```yml tests: - text: euler366() should return 88351299. - testString: 'assert.strictEqual(euler366(), 88351299, ''euler366() should return 88351299.'');' + testString: 'assert.strictEqual(euler366(), 88351299, "euler366() should return 88351299.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-367-bozo-sort.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-367-bozo-sort.english.md index 33b6a276ad..e86647d2bb 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-367-bozo-sort.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-367-bozo-sort.english.md @@ -10,14 +10,14 @@ Bozo sort, not to be confused with the slightly less efficient bogo sort, consis If we consider all permutations of the first 4 natural numbers as input the expectation value of the number of swaps, averaged over all 4! input sequences is 24.75. -The already sorted sequence takes 0 steps. +The already sorted sequence takes 0 steps. In this problem we consider the following variant on bozo sort. If the sequence is not in order we pick three elements at random and shuffle these three elements randomly. -All 3!=6 permutations of those three elements are equally likely. +All 3!=6 permutations of those three elements are equally likely. The already sorted sequence will take 0 steps. -If we consider all permutations of the first 4 natural numbers as input the expectation value of the number of shuffles, averaged over all 4! input sequences is 27.5. +If we consider all permutations of the first 4 natural numbers as input the expectation value of the number of shuffles, averaged over all 4! input sequences is 27.5. Consider as input sequences the permutations of the first 11 natural numbers. Averaged over all 11! input sequences, what is the expected number of shuffles this sorting algorithm will perform? @@ -36,7 +36,7 @@ Give your answer rounded to the nearest integer. ```yml tests: - text: euler367() should return 48271207. - testString: 'assert.strictEqual(euler367(), 48271207, ''euler367() should return 48271207.'');' + testString: 'assert.strictEqual(euler367(), 48271207, "euler367() should return 48271207.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-368-a-kempner-like-series.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-368-a-kempner-like-series.english.md index e30e0c62ee..f3932d22cf 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-368-a-kempner-like-series.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-368-a-kempner-like-series.english.md @@ -33,7 +33,7 @@ Give your answer rounded to 10 digits behind the decimal point. ```yml tests: - text: euler368() should return 253.6135092068. - testString: 'assert.strictEqual(euler368(), 253.6135092068, ''euler368() should return 253.6135092068.'');' + testString: 'assert.strictEqual(euler368(), 253.6135092068, "euler368() should return 253.6135092068.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-369-badugi.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-369-badugi.english.md index 7263c4cd6c..53ff4d39b0 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-369-badugi.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-369-badugi.english.md @@ -24,7 +24,7 @@ Find ∑f(n) for 4 ≤ n ≤ 13. ```yml tests: - text: euler369() should return 862400558448. - testString: 'assert.strictEqual(euler369(), 862400558448, ''euler369() should return 862400558448.'');' + testString: 'assert.strictEqual(euler369(), 862400558448, "euler369() should return 862400558448.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-37-truncatable-primes.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-37-truncatable-primes.english.md index 2b82d1ef7e..cdb31950ba 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-37-truncatable-primes.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-37-truncatable-primes.english.md @@ -22,13 +22,13 @@ NOTE: 2, 3, 5, and 7 are not considered to be truncatable primes. ```yml tests: - text: truncatablePrimes(8) should return 1986. - testString: 'assert(truncatablePrimes(8) == 1986, ''truncatablePrimes(8) should return 1986.'');' + testString: 'assert(truncatablePrimes(8) == 1986, "truncatablePrimes(8) should return 1986.");' - text: truncatablePrimes(9) should return 5123. - testString: 'assert(truncatablePrimes(9) == 5123, ''truncatablePrimes(9) should return 5123.'');' + testString: 'assert(truncatablePrimes(9) == 5123, "truncatablePrimes(9) should return 5123.");' - text: truncatablePrimes(10) should return 8920. - testString: 'assert(truncatablePrimes(10) == 8920, ''truncatablePrimes(10) should return 8920.'');' + testString: 'assert(truncatablePrimes(10) == 8920, "truncatablePrimes(10) should return 8920.");' - text: truncatablePrimes(11) should return 748317. - testString: 'assert(truncatablePrimes(11) == 748317, ''truncatablePrimes(11) should return 748317.'');' + testString: 'assert(truncatablePrimes(11) == 748317, "truncatablePrimes(11) should return 748317.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-370-geometric-triangles.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-370-geometric-triangles.english.md index 336fe2bf24..d3f1d331e8 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-370-geometric-triangles.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-370-geometric-triangles.english.md @@ -6,7 +6,7 @@ title: 'Problem 370: Geometric triangles' ## Description
-Let us define a geometric triangle as an integer sided triangle with sides a ≤ b ≤ c so that its sides form a geometric progression, i.e. b2 = a · c .  +Let us define a geometric triangle as an integer sided triangle with sides a ≤ b ≤ c so that its sides form a geometric progression, i.e. b2 = a · c .  An example of such a geometric triangle is the triangle with sides a = 144, b = 156 and c = 169. @@ -26,7 +26,7 @@ How many geometric triangles exist with perimeter ≤ 2.5·1013 ? ```yml tests: - text: euler370() should return 41791929448408. - testString: 'assert.strictEqual(euler370(), 41791929448408, ''euler370() should return 41791929448408.'');' + testString: 'assert.strictEqual(euler370(), 41791929448408, "euler370() should return 41791929448408.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-371-licence-plates.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-371-licence-plates.english.md index 0e3757da34..13646e3f50 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-371-licence-plates.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-371-licence-plates.english.md @@ -11,7 +11,7 @@ While driving to work Seth plays the following game: Whenever the numbers of two licence plates seen on his trip add to 1000 that's a win. -E.g. MIC-012 and HAN-988 is a win and RYU-500 and SET-500 too. (as long as he sees them in the same trip). +E.g. MIC-012 and HAN-988 is a win and RYU-500 and SET-500 too. (as long as he sees them in the same trip). Find the expected number of plates he needs to see for a win. @@ -32,7 +32,7 @@ Note: We assume that each licence plate seen is equally likely to have any three ```yml tests: - text: euler371() should return 40.66368097. - testString: 'assert.strictEqual(euler371(), 40.66368097, ''euler371() should return 40.66368097.'');' + testString: 'assert.strictEqual(euler371(), 40.66368097, "euler371() should return 40.66368097.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-372-pencils-of-rays.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-372-pencils-of-rays.english.md index 1289f0c31c..79b76516e2 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-372-pencils-of-rays.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-372-pencils-of-rays.english.md @@ -26,7 +26,7 @@ Note: represents the floor function. ```yml tests: - text: euler372() should return 301450082318807040. - testString: 'assert.strictEqual(euler372(), 301450082318807040, ''euler372() should return 301450082318807040.'');' + testString: 'assert.strictEqual(euler372(), 301450082318807040, "euler372() should return 301450082318807040.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-373-circumscribed-circles.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-373-circumscribed-circles.english.md index 6e76763d65..2d416cae93 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-373-circumscribed-circles.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-373-circumscribed-circles.english.md @@ -29,7 +29,7 @@ Find S(107). ```yml tests: - text: euler373() should return 727227472448913. - testString: 'assert.strictEqual(euler373(), 727227472448913, ''euler373() should return 727227472448913.'');' + testString: 'assert.strictEqual(euler373(), 727227472448913, "euler373() should return 727227472448913.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-374-maximum-integer-partition-product.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-374-maximum-integer-partition-product.english.md index ae4a253b51..466cd38ed0 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-374-maximum-integer-partition-product.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-374-maximum-integer-partition-product.english.md @@ -39,7 +39,7 @@ Give your answer modulo 982451653, the 50 millionth prime. ```yml tests: - text: euler374() should return 334420941. - testString: 'assert.strictEqual(euler374(), 334420941, ''euler374() should return 334420941.'');' + testString: 'assert.strictEqual(euler374(), 334420941, "euler374() should return 334420941.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-375-minimum-of-subsequences.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-375-minimum-of-subsequences.english.md index 341065abde..fd33ac246d 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-375-minimum-of-subsequences.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-375-minimum-of-subsequences.english.md @@ -35,7 +35,7 @@ Find M(2 000 000 000). ```yml tests: - text: euler375() should return 7435327983715286000. - testString: 'assert.strictEqual(euler375(), 7435327983715286000, ''euler375() should return 7435327983715286000.'');' + testString: 'assert.strictEqual(euler375(), 7435327983715286000, "euler375() should return 7435327983715286000.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-376-nontransitive-sets-of-dice.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-376-nontransitive-sets-of-dice.english.md index 6cd2d6ab37..743e080912 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-376-nontransitive-sets-of-dice.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-376-nontransitive-sets-of-dice.english.md @@ -56,7 +56,7 @@ How many are there for N = 30 ? ```yml tests: - text: euler376() should return 973059630185670. - testString: 'assert.strictEqual(euler376(), 973059630185670, ''euler376() should return 973059630185670.'');' + testString: 'assert.strictEqual(euler376(), 973059630185670, "euler376() should return 973059630185670.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-377-sum-of-digits-experience-13.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-377-sum-of-digits-experience-13.english.md index 068631f19e..172ee84eee 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-377-sum-of-digits-experience-13.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-377-sum-of-digits-experience-13.english.md @@ -6,7 +6,7 @@ title: 'Problem 377: Sum of digits, experience 13' ## Description
-There are 16 positive integers that do not have a zero in their digits and that have a digital sum equal to 5, namely: +There are 16 positive integers that do not have a zero in their digits and that have a digital sum equal to 5, namely: 5, 14, 23, 32, 41, 113, 122, 131, 212, 221, 311, 1112, 1121, 1211, 2111 and 11111. Their sum is 17891. @@ -29,7 +29,7 @@ Give the last 9 digits as your answer. ```yml tests: - text: euler377() should return 732385277. - testString: 'assert.strictEqual(euler377(), 732385277, ''euler377() should return 732385277.'');' + testString: 'assert.strictEqual(euler377(), 732385277, "euler377() should return 732385277.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-378-triangle-triples.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-378-triangle-triples.english.md index 49b494deed..c3cae87c78 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-378-triangle-triples.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-378-triangle-triples.english.md @@ -23,7 +23,7 @@ Let Tr(n) be the number of triples (i, j, k) such that 1 ≤ i < j < k ≤ n and Tr(20) = 14, Tr(100) = 5772 and Tr(1000) = 11174776. -Find Tr(60 000 000). +Find Tr(60 000 000). Give the last 18 digits of your answer.
@@ -38,7 +38,7 @@ Give the last 18 digits of your answer. ```yml tests: - text: euler378() should return 147534623725724700. - testString: 'assert.strictEqual(euler378(), 147534623725724700, ''euler378() should return 147534623725724700.'');' + testString: 'assert.strictEqual(euler378(), 147534623725724700, "euler378() should return 147534623725724700.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-379-least-common-multiple-count.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-379-least-common-multiple-count.english.md index e471b9df87..8be7af9094 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-379-least-common-multiple-count.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-379-least-common-multiple-count.english.md @@ -9,7 +9,7 @@ title: 'Problem 379: Least common multiple count' Let f(n) be the number of couples (x,y) with x and y positive integers, x ≤ y and the least common multiple of x and y equal to n. -Let g be the summatory function of f, i.e.: +Let g be the summatory function of f, i.e.: g(n) = ∑ f(i) for 1 ≤ i ≤ n. @@ -30,7 +30,7 @@ Find g(1012). ```yml tests: - text: euler379() should return 132314136838185. - testString: 'assert.strictEqual(euler379(), 132314136838185, ''euler379() should return 132314136838185.'');' + testString: 'assert.strictEqual(euler379(), 132314136838185, "euler379() should return 132314136838185.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-38-pandigital-multiples.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-38-pandigital-multiples.english.md index 2075717dba..36d8319d4f 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-38-pandigital-multiples.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-38-pandigital-multiples.english.md @@ -26,7 +26,7 @@ What is the largest 1 to 9 pandigital 9-digit number that can be formed as the c ```yml tests: - text: pandigitalMultiples() should return 932718654. - testString: 'assert.strictEqual(pandigitalMultiples(), 932718654, ''pandigitalMultiples() should return 932718654.'');' + testString: 'assert.strictEqual(pandigitalMultiples(), 932718654, "pandigitalMultiples() should return 932718654.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-380-amazing-mazes.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-380-amazing-mazes.english.md index 3d6cba87ea..6442dc6150 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-380-amazing-mazes.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-380-amazing-mazes.english.md @@ -33,7 +33,7 @@ E.g. if the answer is 1234567891011 then the answer format would be 1.2346e12. ```yml tests: - text: euler380() should return Infinity. - testString: 'assert.strictEqual(euler380(), Infinity, ''euler380() should return Infinity.'');' + testString: 'assert.strictEqual(euler380(), Infinity, "euler380() should return Infinity.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-381-prime-k-factorial.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-381-prime-k-factorial.english.md index dfc669d5c5..00e5cba0f0 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-381-prime-k-factorial.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-381-prime-k-factorial.english.md @@ -10,7 +10,7 @@ For a prime p let S(p) = (∑(p-k)!) mod(p) for 1 ≤ k ≤ 5. For example, if p=7, -(7-1)! + (7-2)! + (7-3)! + (7-4)! + (7-5)! = 6! + 5! + 4! + 3! + 2! = 720+120+24+6+2 = 872. +(7-1)! + (7-2)! + (7-3)! + (7-4)! + (7-5)! = 6! + 5! + 4! + 3! + 2! = 720+120+24+6+2 = 872. As 872 mod(7) = 4, S(7) = 4. @@ -31,7 +31,7 @@ Find ∑S(p) for 5 ≤ p < 108. ```yml tests: - text: euler381() should return 139602943319822. - testString: 'assert.strictEqual(euler381(), 139602943319822, ''euler381() should return 139602943319822.'');' + testString: 'assert.strictEqual(euler381(), 139602943319822, "euler381() should return 139602943319822.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-382-generating-polygons.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-382-generating-polygons.english.md index 62ac7db48e..174179bd93 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-382-generating-polygons.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-382-generating-polygons.english.md @@ -43,7 +43,7 @@ Find the last 9 digits of f(1018). ```yml tests: - text: euler382() should return 697003956. - testString: 'assert.strictEqual(euler382(), 697003956, ''euler382() should return 697003956.'');' + testString: 'assert.strictEqual(euler382(), 697003956, "euler382() should return 697003956.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-383-divisibility-comparison-between-factorials.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-383-divisibility-comparison-between-factorials.english.md index c3afbd566d..18285a4ff2 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-383-divisibility-comparison-between-factorials.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-383-divisibility-comparison-between-factorials.english.md @@ -30,7 +30,7 @@ Find T5(1018). ```yml tests: - text: euler383() should return 22173624649806. - testString: 'assert.strictEqual(euler383(), 22173624649806, ''euler383() should return 22173624649806.'');' + testString: 'assert.strictEqual(euler383(), 22173624649806, "euler383() should return 22173624649806.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-384-rudin-shapiro-sequence.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-384-rudin-shapiro-sequence.english.md index 679e1e0a8d..c2d6f36b61 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-384-rudin-shapiro-sequence.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-384-rudin-shapiro-sequence.english.md @@ -44,7 +44,7 @@ Find ΣGF(t) for 2≤t≤45. ```yml tests: - text: euler384() should return 3354706415856333000. - testString: 'assert.strictEqual(euler384(), 3354706415856333000, ''euler384() should return 3354706415856333000.'');' + testString: 'assert.strictEqual(euler384(), 3354706415856333000, "euler384() should return 3354706415856333000.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-385-ellipses-inside-triangles.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-385-ellipses-inside-triangles.english.md index 6945d0985d..544ffe27d5 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-385-ellipses-inside-triangles.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-385-ellipses-inside-triangles.english.md @@ -11,7 +11,7 @@ For any triangle T in the plane, it can be shown that there is a unique ellipse For a given n, consider triangles T such that: -- the vertices of T have integer coordinates with absolute value ≤ n, and +- the vertices of T have integer coordinates with absolute value ≤ n, and - the foci1 of the largest-area ellipse inside T are (√13,0) and (-√13,0). Let A(n) be the sum of the areas of all such triangles. @@ -40,7 +40,7 @@ Find A(1 000 000 000). ```yml tests: - text: euler385() should return 3776957309612154000. - testString: 'assert.strictEqual(euler385(), 3776957309612154000, ''euler385() should return 3776957309612154000.'');' + testString: 'assert.strictEqual(euler385(), 3776957309612154000, "euler385() should return 3776957309612154000.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-386-maximum-length-of-an-antichain.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-386-maximum-length-of-an-antichain.english.md index 3a9a9b8391..d7abf76f69 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-386-maximum-length-of-an-antichain.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-386-maximum-length-of-an-antichain.english.md @@ -30,7 +30,7 @@ Find ΣN(n) for 1 ≤ n ≤ 108 ```yml tests: - text: euler386() should return 528755790. - testString: 'assert.strictEqual(euler386(), 528755790, ''euler386() should return 528755790.'');' + testString: 'assert.strictEqual(euler386(), 528755790, "euler386() should return 528755790.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-387-harshad-numbers.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-387-harshad-numbers.english.md index 9fb0973662..763207000b 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-387-harshad-numbers.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-387-harshad-numbers.english.md @@ -10,7 +10,7 @@ A Harshad or Niven number is a number that is divisible by the sum of its digits 201 is a Harshad number because it is divisible by 3 (the sum of its digits.) When we truncate the last digit from 201, we get 20, which is a Harshad number. When we truncate the last digit from 20, we get 2, which is also a Harshad number. -Let's call a Harshad number that, while recursively truncating the last digit, always results in a Harshad number a right truncatable Harshad number. +Let's call a Harshad number that, while recursively truncating the last digit, always results in a Harshad number a right truncatable Harshad number. Also: 201/3=67 which is prime. @@ -36,7 +36,7 @@ Find the sum of the strong, right truncatable Harshad primes less than 1014. ```yml tests: - text: euler387() should return 696067597313468. - testString: 'assert.strictEqual(euler387(), 696067597313468, ''euler387() should return 696067597313468.'');' + testString: 'assert.strictEqual(euler387(), 696067597313468, "euler387() should return 696067597313468.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-388-distinct-lines.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-388-distinct-lines.english.md index 91956f0fa0..587d023470 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-388-distinct-lines.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-388-distinct-lines.english.md @@ -29,7 +29,7 @@ Find D(1010). Give as your answer the first nine digits followed by the last nin ```yml tests: - text: euler388() should return 831907372805130000. - testString: 'assert.strictEqual(euler388(), 831907372805130000, ''euler388() should return 831907372805130000.'');' + testString: 'assert.strictEqual(euler388(), 831907372805130000, "euler388() should return 831907372805130000.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-389-platonic-dice.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-389-platonic-dice.english.md index b6761e62b5..1effc3812f 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-389-platonic-dice.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-389-platonic-dice.english.md @@ -21,7 +21,7 @@ Find the variance of I, and give your answer rounded to 4 decimal places. ```yml tests: - text: euler389() should return 2406376.3623. - testString: 'assert.strictEqual(euler389(), 2406376.3623, ''euler389() should return 2406376.3623.'');' + testString: 'assert.strictEqual(euler389(), 2406376.3623, "euler389() should return 2406376.3623.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-39-integer-right-triangles.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-39-integer-right-triangles.english.md index a66ebe19ed..91b49b913f 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-39-integer-right-triangles.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-39-integer-right-triangles.english.md @@ -22,13 +22,13 @@ For which value of p ≤ n, is the number of solutions maximised? ```yml tests: - text: intRightTriangles(500) should return 420. - testString: 'assert(intRightTriangles(500) == 420, ''intRightTriangles(500) should return 420.'');' + testString: 'assert(intRightTriangles(500) == 420, "intRightTriangles(500) should return 420.");' - text: intRightTriangles(800) should return 420. - testString: 'assert(intRightTriangles(800) == 420, ''intRightTriangles(800) should return 420.'');' + testString: 'assert(intRightTriangles(800) == 420, "intRightTriangles(800) should return 420.");' - text: intRightTriangles(900) should return 840. - testString: 'assert(intRightTriangles(900) == 840, ''intRightTriangles(900) should return 840.'');' + testString: 'assert(intRightTriangles(900) == 840, "intRightTriangles(900) should return 840.");' - text: intRightTriangles(1000) should return 840. - testString: 'assert(intRightTriangles(1000) == 840, ''intRightTriangles(1000) should return 840.'');' + testString: 'assert(intRightTriangles(1000) == 840, "intRightTriangles(1000) should return 840.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-390-triangles-with-non-rational-sides-and-integral-area.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-390-triangles-with-non-rational-sides-and-integral-area.english.md index 6eac408261..b6407af9cb 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-390-triangles-with-non-rational-sides-and-integral-area.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-390-triangles-with-non-rational-sides-and-integral-area.english.md @@ -29,7 +29,7 @@ Find S(1010). ```yml tests: - text: euler390() should return 2919133642971. - testString: 'assert.strictEqual(euler390(), 2919133642971, ''euler390() should return 2919133642971.'');' + testString: 'assert.strictEqual(euler390(), 2919133642971, "euler390() should return 2919133642971.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-391-hopping-game.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-391-hopping-game.english.md index 2af506276d..148f9ebafe 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-391-hopping-game.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-391-hopping-game.english.md @@ -47,7 +47,7 @@ Find Σ(M(n))3 for 1 ≤ n ≤ 1000. ```yml tests: - text: euler391() should return 61029882288. - testString: 'assert.strictEqual(euler391(), 61029882288, ''euler391() should return 61029882288.'');' + testString: 'assert.strictEqual(euler391(), 61029882288, "euler391() should return 61029882288.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-392-enmeshed-unit-circle.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-392-enmeshed-unit-circle.english.md index 5cb1ba77f5..19f2310e9b 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-392-enmeshed-unit-circle.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-392-enmeshed-unit-circle.english.md @@ -21,7 +21,7 @@ E.g. here is a picture of the solution for N = 10: The area occupied by the red cells for N = 10 rounded to 10 digits behind the decimal point is 3.3469640797. -Find the positions for N = 400. +Find the positions for N = 400. Give as your answer the area occupied by the red cells rounded to 10 digits behind the decimal point.
@@ -36,7 +36,7 @@ Give as your answer the area occupied by the red cells rounded to 10 digits behi ```yml tests: - text: euler392() should return 3.1486734435. - testString: 'assert.strictEqual(euler392(), 3.1486734435, ''euler392() should return 3.1486734435.'');' + testString: 'assert.strictEqual(euler392(), 3.1486734435, "euler392() should return 3.1486734435.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-393-migrating-ants.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-393-migrating-ants.english.md index 87af71b34b..2d54e46d34 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-393-migrating-ants.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-393-migrating-ants.english.md @@ -26,7 +26,7 @@ Find f(10). ```yml tests: - text: euler393() should return 112398351350823100. - testString: 'assert.strictEqual(euler393(), 112398351350823100, ''euler393() should return 112398351350823100.'');' + testString: 'assert.strictEqual(euler393(), 112398351350823100, "euler393() should return 112398351350823100.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-394-eating-pie.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-394-eating-pie.english.md index fc7da9a575..79f6441589 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-394-eating-pie.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-394-eating-pie.english.md @@ -9,7 +9,7 @@ title: 'Problem 394: Eating pie' Jeff eats a pie in an unusual way. The pie is circular. He starts with slicing an initial cut in the pie along a radius. While there is at least a given fraction F of pie left, he performs the following procedure: -- He makes two slices from the pie centre to any point of what is remaining of the pie border, any point on the remaining pie border equally likely. This will divide the remaining pie into three pieces. +- He makes two slices from the pie centre to any point of what is remaining of the pie border, any point on the remaining pie border equally likely. This will divide the remaining pie into three pieces. - Going counterclockwise from the initial cut, he takes the first two pie pieces and eats them. When less than a fraction F of pie remains, he does not repeat this procedure. Instead, he eats all of the remaining pie. @@ -36,7 +36,7 @@ Find E(40) rounded to 10 decimal places behind the decimal point. ```yml tests: - text: euler394() should return 3.2370342194. - testString: 'assert.strictEqual(euler394(), 3.2370342194, ''euler394() should return 3.2370342194.'');' + testString: 'assert.strictEqual(euler394(), 3.2370342194, "euler394() should return 3.2370342194.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-395-pythagorean-tree.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-395-pythagorean-tree.english.md index 1df48af9ad..efe1ee5d99 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-395-pythagorean-tree.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-395-pythagorean-tree.english.md @@ -38,7 +38,7 @@ Find the smallest area possible for such a bounding rectangle, and give your ans ```yml tests: - text: euler395() should return 28.2453753155. - testString: 'assert.strictEqual(euler395(), 28.2453753155, ''euler395() should return 28.2453753155.'');' + testString: 'assert.strictEqual(euler395(), 28.2453753155, "euler395() should return 28.2453753155.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-396-weak-goodstein-sequence.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-396-weak-goodstein-sequence.english.md index f0c23f6bd8..dc5c04c36b 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-396-weak-goodstein-sequence.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-396-weak-goodstein-sequence.english.md @@ -44,7 +44,7 @@ Find the last 9 digits of ΣG(n) for 1 ≤ n < 16. ```yml tests: - text: euler396() should return 173214653. - testString: 'assert.strictEqual(euler396(), 173214653, ''euler396() should return 173214653.'');' + testString: 'assert.strictEqual(euler396(), 173214653, "euler396() should return 173214653.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-397-triangle-on-parabola.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-397-triangle-on-parabola.english.md index be473c1f69..f04965a632 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-397-triangle-on-parabola.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-397-triangle-on-parabola.english.md @@ -27,7 +27,7 @@ Find F(106, 109). ```yml tests: - text: euler397() should return 141630459461893730. - testString: 'assert.strictEqual(euler397(), 141630459461893730, ''euler397() should return 141630459461893730.'');' + testString: 'assert.strictEqual(euler397(), 141630459461893730, "euler397() should return 141630459461893730.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-398-cutting-rope.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-398-cutting-rope.english.md index a9fc02b0ce..b326196254 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-398-cutting-rope.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-398-cutting-rope.english.md @@ -29,7 +29,7 @@ Give your answer rounded to 5 decimal places behind the decimal point. ```yml tests: - text: euler398() should return 2010.59096. - testString: 'assert.strictEqual(euler398(), 2010.59096, ''euler398() should return 2010.59096.'');' + testString: 'assert.strictEqual(euler398(), 2010.59096, "euler398() should return 2010.59096.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-399-squarefree-fibonacci-numbers.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-399-squarefree-fibonacci-numbers.english.md index 91805b26d4..dacb318ecd 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-399-squarefree-fibonacci-numbers.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-399-squarefree-fibonacci-numbers.english.md @@ -8,7 +8,7 @@ title: 'Problem 399: Squarefree Fibonacci Numbers'
The first 15 fibonacci numbers are: 1,1,2,3,5,8,13,21,34,55,89,144,233,377,610. -It can be seen that 8 and 144 are not squarefree: 8 is divisible by 4 and 144 is divisible by 4 and by 9. +It can be seen that 8 and 144 are not squarefree: 8 is divisible by 4 and 144 is divisible by 4 and by 9. So the first 13 squarefree fibonacci numbers are: 1,1,2,3,5,13,21,34,55,89,233,377 and 610. @@ -24,7 +24,7 @@ For the 200th squarefree number the answer would have been: 1608739584170445,9.7 -Note: +Note: For this problem, assume that for every prime p, the first fibonacci number divisible by p is not divisible by p2 (this is part of Wall's conjecture). This has been verified for primes ≤ 3·1015, but has not been proven in general. If it happens that the conjecture is false, then the accepted answer to this problem isn't guaranteed to be the 100 000 000th squarefree fibonacci number, rather it represents only a lower bound for that number. @@ -41,7 +41,7 @@ If it happens that the conjecture is false, then the accepted answer to this pro ```yml tests: - text: 'euler399() should return 1508395636674243, 6.5e27330467.' - testString: 'assert.strictEqual(euler399(), 1508395636674243, 6.5e27330467, ''euler399() should return 1508395636674243, 6.5e27330467.'');' + testString: 'assert.strictEqual(euler399(), 1508395636674243, 6.5e27330467, "euler399() should return 1508395636674243, 6.5e27330467.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-4-largest-palindrome-product.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-4-largest-palindrome-product.english.md index afab007b3d..fad6869c89 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-4-largest-palindrome-product.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-4-largest-palindrome-product.english.md @@ -21,9 +21,9 @@ Find the largest palindrome made from the product of two n-digit nu ```yml tests: - text: largestPalindromeProduct(2) should return 9009. - testString: 'assert.strictEqual(largestPalindromeProduct(2), 9009, ''largestPalindromeProduct(2) should return 9009.'');' + testString: 'assert.strictEqual(largestPalindromeProduct(2), 9009, "largestPalindromeProduct(2) should return 9009.");' - text: largestPalindromeProduct(3) should return 906609. - testString: 'assert.strictEqual(largestPalindromeProduct(3), 906609, ''largestPalindromeProduct(3) should return 906609.'');' + testString: 'assert.strictEqual(largestPalindromeProduct(3), 906609, "largestPalindromeProduct(3) should return 906609.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-40-champernownes-constant.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-40-champernownes-constant.english.md index 6070e17299..df6a447a61 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-40-champernownes-constant.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-40-champernownes-constant.english.md @@ -1,7 +1,7 @@ --- id: 5900f3941000cf542c50fea7 challengeType: 5 -title: 'Problem 40: Champernowne''s constant' +title: 'Problem 40: Champernowne"s constant' --- ## Description @@ -24,11 +24,11 @@ If dn represents the nth digit of the fracti ```yml tests: - text: champernownesConstant(100) should return 5. - testString: 'assert.strictEqual(champernownesConstant(100), 5, ''champernownesConstant(100) should return 5.'');' + testString: 'assert.strictEqual(champernownesConstant(100), 5, "champernownesConstant(100) should return 5.");' - text: champernownesConstant(1000) should return 15. - testString: 'assert.strictEqual(champernownesConstant(1000), 15, ''champernownesConstant(1000) should return 15.'');' + testString: 'assert.strictEqual(champernownesConstant(1000), 15, "champernownesConstant(1000) should return 15.");' - text: champernownesConstant(1000000) should return 210. - testString: 'assert.strictEqual(champernownesConstant(1000000), 210, ''champernownesConstant(1000000) should return 210.'');' + testString: 'assert.strictEqual(champernownesConstant(1000000), 210, "champernownesConstant(1000000) should return 210.");' ``` @@ -60,7 +60,7 @@ champernownesConstant(100); ```js function champernownesConstant(n) { - let fractionalPart = ''; + let fractionalPart = "; for (let i = 0; fractionalPart.length <= n; i++) { fractionalPart += i.toString(); } diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-400-fibonacci-tree-game.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-400-fibonacci-tree-game.english.md index 1e2e1eab05..051e7c3833 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-400-fibonacci-tree-game.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-400-fibonacci-tree-game.english.md @@ -41,7 +41,7 @@ Find f(10000). Give the last 18 digits of your answer. ```yml tests: - text: euler400() should return 438505383468410600. - testString: 'assert.strictEqual(euler400(), 438505383468410600, ''euler400() should return 438505383468410600.'');' + testString: 'assert.strictEqual(euler400(), 438505383468410600, "euler400() should return 438505383468410600.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-401-sum-of-squares-of-divisors.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-401-sum-of-squares-of-divisors.english.md index 68314cc282..a43a6edd9c 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-401-sum-of-squares-of-divisors.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-401-sum-of-squares-of-divisors.english.md @@ -31,7 +31,7 @@ Find SIGMA2(1015) modulo 109. ```yml tests: - text: euler401() should return 281632621. - testString: 'assert.strictEqual(euler401(), 281632621, ''euler401() should return 281632621.'');' + testString: 'assert.strictEqual(euler401(), 281632621, "euler401() should return 281632621.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-402-integer-valued-polynomials.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-402-integer-valued-polynomials.english.md index 0a587acce5..6ddc603bc7 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-402-integer-valued-polynomials.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-402-integer-valued-polynomials.english.md @@ -37,7 +37,7 @@ Find the last 9 digits of Σ S(Fk) for 2 ≤ k ≤ 1234567890123. ```yml tests: - text: euler402() should return 356019862. - testString: 'assert.strictEqual(euler402(), 356019862, ''euler402() should return 356019862.'');' + testString: 'assert.strictEqual(euler402(), 356019862, "euler402() should return 356019862.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-403-lattice-points-enclosed-by-parabola-and-line.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-403-lattice-points-enclosed-by-parabola-and-line.english.md index 96953982e4..b42b7be59e 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-403-lattice-points-enclosed-by-parabola-and-line.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-403-lattice-points-enclosed-by-parabola-and-line.english.md @@ -31,7 +31,7 @@ Find S(1012). Give your answer mod 108. ```yml tests: - text: euler403() should return 18224771. - testString: 'assert.strictEqual(euler403(), 18224771, ''euler403() should return 18224771.'');' + testString: 'assert.strictEqual(euler403(), 18224771, "euler403() should return 18224771.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-404-crisscross-ellipses.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-404-crisscross-ellipses.english.md index e2a67fb43d..c74527ed90 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-404-crisscross-ellipses.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-404-crisscross-ellipses.english.md @@ -39,7 +39,7 @@ Find C(1017). ```yml tests: - text: euler404() should return 1199215615081353. - testString: 'assert.strictEqual(euler404(), 1199215615081353, ''euler404() should return 1199215615081353.'');' + testString: 'assert.strictEqual(euler404(), 1199215615081353, "euler404() should return 1199215615081353.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-405-a-rectangular-tiling.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-405-a-rectangular-tiling.english.md index bbee2256d9..45d1c2a3fb 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-405-a-rectangular-tiling.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-405-a-rectangular-tiling.english.md @@ -41,7 +41,7 @@ Find f(10k) for k = 1018, give your answer modulo 177. ```yml tests: - text: euler405() should return 237696125. - testString: 'assert.strictEqual(euler405(), 237696125, ''euler405() should return 237696125.'');' + testString: 'assert.strictEqual(euler405(), 237696125, "euler405() should return 237696125.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-406-guessing-game.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-406-guessing-game.english.md index fdaab59a61..07d4704fc3 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-406-guessing-game.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-406-guessing-game.english.md @@ -6,7 +6,7 @@ title: 'Problem 406: Guessing Game' ## Description
-We are trying to find a hidden number selected from the set of integers {1, 2, ..., n} by asking questions. +We are trying to find a hidden number selected from the set of integers {1, 2, ..., n} by asking questions. Each number (question) we ask, we get one of three possible answers: "Your guess is lower than the hidden number" (and you incur a cost of a), or "Your guess is higher than the hidden number" (and you incur a cost of b), or "Yes, that's it!" (and the game ends). @@ -18,7 +18,7 @@ If we are told that 2 is higher than the hidden number (for a cost of b=3), then If we are told that 2 is lower than the hidden number (for a cost of a=2), then our next question will be "4". If we are told that 4 is higher than the hidden number (for a cost of b=3), then we are sure that "3" is the hidden number (for a total cost of 2+3=5). If we are told that 4 is lower than the hidden number (for a cost of a=2), then we are sure that "5" is the hidden number (for a total cost of 2+2=4). -Thus, the worst-case cost achieved by this strategy is 5. It can also be shown that this is the lowest worst-case cost that can be achieved. +Thus, the worst-case cost achieved by this strategy is 5. It can also be shown that this is the lowest worst-case cost that can be achieved. So, in fact, we have just described an optimal strategy for the given values of n, a, and b. Let C(n, a, b) be the worst-case cost achieved by an optimal strategy for the given values of n, a, and b. @@ -43,7 +43,7 @@ Let Fk be the Fibonacci numbers: Fk = Fk-1 + Fk-2 with base cases F1 = F2 = 1.Fi ```yml tests: - text: euler406() should return 36813.12757207. - testString: 'assert.strictEqual(euler406(), 36813.12757207, ''euler406() should return 36813.12757207.'');' + testString: 'assert.strictEqual(euler406(), 36813.12757207, "euler406() should return 36813.12757207.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-407-idempotents.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-407-idempotents.english.md index 2d0f95a4ac..5fcd57e433 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-407-idempotents.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-407-idempotents.english.md @@ -28,7 +28,7 @@ Find ∑M(n) for 1 ≤ n ≤ 107. ```yml tests: - text: euler407() should return 39782849136421. - testString: 'assert.strictEqual(euler407(), 39782849136421, ''euler407() should return 39782849136421.'');' + testString: 'assert.strictEqual(euler407(), 39782849136421, "euler407() should return 39782849136421.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-408-admissible-paths-through-a-grid.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-408-admissible-paths-through-a-grid.english.md index d1fc3da0a3..fce6478c88 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-408-admissible-paths-through-a-grid.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-408-admissible-paths-through-a-grid.english.md @@ -29,7 +29,7 @@ Find P(10 000 000) mod 1 000 000 007. ```yml tests: - text: euler408() should return 299742733. - testString: 'assert.strictEqual(euler408(), 299742733, ''euler408() should return 299742733.'');' + testString: 'assert.strictEqual(euler408(), 299742733, "euler408() should return 299742733.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-409-nim-extreme.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-409-nim-extreme.english.md index 868e258e2a..aa73daadd7 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-409-nim-extreme.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-409-nim-extreme.english.md @@ -26,7 +26,7 @@ Find W(10 000 000) mod 1 000 000 007. ```yml tests: - text: euler409() should return 253223948. - testString: 'assert.strictEqual(euler409(), 253223948, ''euler409() should return 253223948.'');' + testString: 'assert.strictEqual(euler409(), 253223948, "euler409() should return 253223948.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-41-pandigital-prime.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-41-pandigital-prime.english.md index 6afd2c6603..023c0fe7d2 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-41-pandigital-prime.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-41-pandigital-prime.english.md @@ -21,9 +21,9 @@ What is the largest n-length digit pandigital prime that exists? ```yml tests: - text: pandigitalPrime(4) should return 4231. - testString: 'assert(pandigitalPrime(4) == 4231, ''pandigitalPrime(4) should return 4231.'');' + testString: 'assert(pandigitalPrime(4) == 4231, "pandigitalPrime(4) should return 4231.");' - text: pandigitalPrime(7) should return 7652413. - testString: 'assert(pandigitalPrime(7) == 7652413, ''pandigitalPrime(7) should return 7652413.'');' + testString: 'assert(pandigitalPrime(7) == 7652413, "pandigitalPrime(7) should return 7652413.");' ``` @@ -88,7 +88,7 @@ function pandigitalPrime(n) { let max = 0; let permutations = []; let digitsArr; - let pandigitalNum = ''; + let pandigitalNum = "; for (let max = n; max > 0; max--) { pandigitalNum += max; diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-410-circle-and-tangent-line.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-410-circle-and-tangent-line.english.md index f4e253bd7b..cb017361ab 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-410-circle-and-tangent-line.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-410-circle-and-tangent-line.english.md @@ -27,7 +27,7 @@ Find F(108, 109) + F(109, 108). ```yml tests: - text: euler410() should return 799999783589946600. - testString: 'assert.strictEqual(euler410(), 799999783589946600, ''euler410() should return 799999783589946600.'');' + testString: 'assert.strictEqual(euler410(), 799999783589946600, "euler410() should return 799999783589946600.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-411-uphill-paths.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-411-uphill-paths.english.md index 579235c6b4..464274d58b 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-411-uphill-paths.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-411-uphill-paths.english.md @@ -32,7 +32,7 @@ Find ∑ S(k5) for 1 ≤ k ≤ 30. ```yml tests: - text: euler411() should return 9936352. - testString: 'assert.strictEqual(euler411(), 9936352, ''euler411() should return 9936352.'');' + testString: 'assert.strictEqual(euler411(), 9936352, "euler411() should return 9936352.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-412-gnomon-numbering.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-412-gnomon-numbering.english.md index c4d34fcefc..26809d3369 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-412-gnomon-numbering.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-412-gnomon-numbering.english.md @@ -34,7 +34,7 @@ Find LC(10000, 5000) mod 76543217. ```yml tests: - text: euler412() should return 38788800. - testString: 'assert.strictEqual(euler412(), 38788800, ''euler412() should return 38788800.'');' + testString: 'assert.strictEqual(euler412(), 38788800, "euler412() should return 38788800.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-413-one-child-numbers.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-413-one-child-numbers.english.md index 04e8bd657c..8d60aa1e5b 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-413-one-child-numbers.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-413-one-child-numbers.english.md @@ -29,7 +29,7 @@ Find F(1019). ```yml tests: - text: euler413() should return 3079418648040719. - testString: 'assert.strictEqual(euler413(), 3079418648040719, ''euler413() should return 3079418648040719.'');' + testString: 'assert.strictEqual(euler413(), 3079418648040719, "euler413() should return 3079418648040719.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-414-kaprekar-constant.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-414-kaprekar-constant.english.md index 0764fd1839..7187df63ee 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-414-kaprekar-constant.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-414-kaprekar-constant.english.md @@ -7,7 +7,7 @@ title: 'Problem 414: Kaprekar constant' ## Description
6174 is a remarkable number; if we sort its digits in increasing order and subtract that number from the number you get when you sort the digits in decreasing order, we get 7641-1467=6174. -Even more remarkable is that if we start from any 4 digit number and repeat this process of sorting and subtracting, we'll eventually end up with 6174 or immediately with 0 if all digits are equal. +Even more remarkable is that if we start from any 4 digit number and repeat this process of sorting and subtracting, we'll eventually end up with 6174 or immediately with 0 if all digits are equal. This also works with numbers that have less than 4 digits if we pad the number with leading zeroes until we have 4 digits. E.g. let's start with the number 0837: 8730-0378=8352 @@ -17,7 +17,7 @@ E.g. let's start with the number 0837: 6174 is called the Kaprekar constant. The process of sorting and subtracting and repeating this until either 0 or the Kaprekar constant is reached is called the Kaprekar routine. -We can consider the Kaprekar routine for other bases and number of digits. +We can consider the Kaprekar routine for other bases and number of digits. Unfortunately, it is not guaranteed a Kaprekar constant exists in all cases; either the routine can end up in a cycle for some input numbers or the constant the routine arrives at can be different for different input numbers. However, it can be shown that for 5 digits and a base b = 6t+3≠9, a Kaprekar constant exists. E.g. base 15: (10,4,14,9,5)15 @@ -32,7 +32,7 @@ Note that we can define sb(i) for all integers i < b5. If i written in base b ta Define S(b) as the sum of sb(i) for 0 < i < b5. -E.g. S(15) = 5274369 +E.g. S(15) = 5274369 S(111) = 400668930299 @@ -51,7 +51,7 @@ Give the last 18 digits as your answer. ```yml tests: - text: euler414() should return 552506775824935500. - testString: 'assert.strictEqual(euler414(), 552506775824935500, ''euler414() should return 552506775824935500.'');' + testString: 'assert.strictEqual(euler414(), 552506775824935500, "euler414() should return 552506775824935500.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-415-titanic-sets.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-415-titanic-sets.english.md index 5d2d23eac2..f795651fb1 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-415-titanic-sets.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-415-titanic-sets.english.md @@ -29,7 +29,7 @@ Find T(1011) mod 108. ```yml tests: - text: euler415() should return 55859742. - testString: 'assert.strictEqual(euler415(), 55859742, ''euler415() should return 55859742.'');' + testString: 'assert.strictEqual(euler415(), 55859742, "euler415() should return 55859742.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-416-a-frogs-trip.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-416-a-frogs-trip.english.md index 97d4a0a2cb..0d1f707d9a 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-416-a-frogs-trip.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-416-a-frogs-trip.english.md @@ -1,7 +1,7 @@ --- id: 5900f50e1000cf542c510020 challengeType: 5 -title: 'Problem 416: A frog''s trip' +title: 'Problem 416: A frog"s trip' --- ## Description @@ -25,7 +25,7 @@ Find the last 9 digits of F(10, 1012). ```yml tests: - text: euler416() should return 898082747. - testString: 'assert.strictEqual(euler416(), 898082747, ''euler416() should return 898082747.'');' + testString: 'assert.strictEqual(euler416(), 898082747, "euler416() should return 898082747.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-417-reciprocal-cycles-ii.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-417-reciprocal-cycles-ii.english.md index 21bc8efc1c..b6bf9fef06 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-417-reciprocal-cycles-ii.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-417-reciprocal-cycles-ii.english.md @@ -21,7 +21,7 @@ A unit fraction contains 1 in the numerator. The decimal representation of the u Where 0.1(6) means 0.166666..., and has a 1-digit recurring cycle. It can be seen that 1/7 has a 6-digit recurring cycle. Unit fractions whose denominator has no other prime factors than 2 and/or 5 are not considered to have a recurring cycle. -We define the length of the recurring cycle of those unit fractions as 0. +We define the length of the recurring cycle of those unit fractions as 0. Let L(n) denote the length of the recurring cycle of 1/n. @@ -42,7 +42,7 @@ Find ∑L(n) for 3 ≤ n ≤ 100 000 000 ```yml tests: - text: euler417() should return 446572970925740. - testString: 'assert.strictEqual(euler417(), 446572970925740, ''euler417() should return 446572970925740.'');' + testString: 'assert.strictEqual(euler417(), 446572970925740, "euler417() should return 446572970925740.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-418-factorisation-triples.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-418-factorisation-triples.english.md index c781de54dd..05ce974392 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-418-factorisation-triples.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-418-factorisation-triples.english.md @@ -29,7 +29,7 @@ Find f(43!). ```yml tests: - text: euler418() should return 1177163565297340400. - testString: 'assert.strictEqual(euler418(), 1177163565297340400, ''euler418() should return 1177163565297340400.'');' + testString: 'assert.strictEqual(euler418(), 1177163565297340400, "euler418() should return 1177163565297340400.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-419-look-and-say-sequence.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-419-look-and-say-sequence.english.md index 3cc4eb595b..a24a603858 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-419-look-and-say-sequence.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-419-look-and-say-sequence.english.md @@ -11,7 +11,7 @@ The sequence starts with 1 and all other members are obtained by describing the It helps to do this out loud: 1 is 'one one' → 11 11 is 'two ones' → 21 -21 is 'one two and one one' → 1211 +21 is 'one two and one one' → 1211 1211 is 'one one, one two and two ones' → 111221 111221 is 'three ones, two twos and one one' → 312211 ... @@ -21,8 +21,8 @@ Define A(n), B(n) and C(n) as the number of ones, twos and threes in the n'th el One can verify that A(40) = 31254, B(40) = 20259 and C(40) = 11625. -Find A(n), B(n) and C(n) for n = 1012. -Give your answer modulo 230 and separate your values for A, B and C by a comma. +Find A(n), B(n) and C(n) for n = 1012. +Give your answer modulo 230 and separate your values for A, B and C by a comma. E.g. for n = 40 the answer would be 31254,20259,11625
@@ -37,7 +37,7 @@ E.g. for n = 40 the answer would be 31254,20259,11625 ```yml tests: - text: 'euler419() should return 998567458, 1046245404, 43363922.' - testString: 'assert.strictEqual(euler419(), 998567458, 1046245404, 43363922, ''euler419() should return 998567458, 1046245404, 43363922.'');' + testString: 'assert.strictEqual(euler419(), 998567458, 1046245404, 43363922, "euler419() should return 998567458, 1046245404, 43363922.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-42-coded-triangle-numbers.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-42-coded-triangle-numbers.english.md index 4cf50270c8..36841f6cb8 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-42-coded-triangle-numbers.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-42-coded-triangle-numbers.english.md @@ -23,13 +23,13 @@ Using words array of n-length, how many are triangle words? ```yml tests: - text: codedTriangleNumbers(1400) should return 129. - testString: 'assert(codedTriangleNumbers(1400) == 129, ''codedTriangleNumbers(1400) should return 129.'');' + testString: 'assert(codedTriangleNumbers(1400) == 129, "codedTriangleNumbers(1400) should return 129.");' - text: codedTriangleNumbers(1500) should return 137. - testString: 'assert(codedTriangleNumbers(1500) == 137, ''codedTriangleNumbers(1500) should return 137.'');' + testString: 'assert(codedTriangleNumbers(1500) == 137, "codedTriangleNumbers(1500) should return 137.");' - text: codedTriangleNumbers(1600) should return 141. - testString: 'assert(codedTriangleNumbers(1600) == 141, ''codedTriangleNumbers(1600) should return 141.'');' + testString: 'assert(codedTriangleNumbers(1600) == 141, "codedTriangleNumbers(1600) should return 141.");' - text: codedTriangleNumbers(1786) should return 162. - testString: 'assert(codedTriangleNumbers(1786) == 162, ''codedTriangleNumbers(1786) should return 162.'');' + testString: 'assert(codedTriangleNumbers(1786) == 162, "codedTriangleNumbers(1786) should return 162.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-420-2x2-positive-integer-matrix.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-420-2x2-positive-integer-matrix.english.md index 1ad5705c56..6c8378c45b 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-420-2x2-positive-integer-matrix.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-420-2x2-positive-integer-matrix.english.md @@ -32,7 +32,7 @@ Find F(107). ```yml tests: - text: euler420() should return 145159332. - testString: 'assert.strictEqual(euler420(), 145159332, ''euler420() should return 145159332.'');' + testString: 'assert.strictEqual(euler420(), 145159332, "euler420() should return 145159332.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-421-prime-factors-of-n151.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-421-prime-factors-of-n151.english.md index 0149c3d2ec..46c96cd62f 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-421-prime-factors-of-n151.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-421-prime-factors-of-n151.english.md @@ -28,7 +28,7 @@ Find ∑ s(n,108) for 1 ≤ n ≤ 1011. ```yml tests: - text: euler421() should return 2304215802083466200. - testString: 'assert.strictEqual(euler421(), 2304215802083466200, ''euler421() should return 2304215802083466200.'');' + testString: 'assert.strictEqual(euler421(), 2304215802083466200, "euler421() should return 2304215802083466200.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-422-sequence-of-points-on-a-hyperbola.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-422-sequence-of-points-on-a-hyperbola.english.md index eb00572a74..da54ec5885 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-422-sequence-of-points-on-a-hyperbola.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-422-sequence-of-points-on-a-hyperbola.english.md @@ -32,7 +32,7 @@ For n = 7, the answer would have been: 806236837. ```yml tests: - text: euler422() should return 92060460. - testString: 'assert.strictEqual(euler422(), 92060460, ''euler422() should return 92060460.'');' + testString: 'assert.strictEqual(euler422(), 92060460, "euler422() should return 92060460.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-423-consecutive-die-throws.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-423-consecutive-die-throws.english.md index e0d362a40d..6a2fe149ef 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-423-consecutive-die-throws.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-423-consecutive-die-throws.english.md @@ -37,7 +37,7 @@ Find S(50 000 000) mod 1 000 000 007. ```yml tests: - text: euler423() should return 653972374. - testString: 'assert.strictEqual(euler423(), 653972374, ''euler423() should return 653972374.'');' + testString: 'assert.strictEqual(euler423(), 653972374, "euler423() should return 653972374.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-424-kakuro.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-424-kakuro.english.md index 5d18b29fb4..59651a8dab 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-424-kakuro.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-424-kakuro.english.md @@ -40,7 +40,7 @@ Find the sum of the answers for the 200 puzzles. ```yml tests: - text: euler424() should return 1059760019628. - testString: 'assert.strictEqual(euler424(), 1059760019628, ''euler424() should return 1059760019628.'');' + testString: 'assert.strictEqual(euler424(), 1059760019628, "euler424() should return 1059760019628.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-425-prime-connection.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-425-prime-connection.english.md index f8a8c0ada4..0d019363f0 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-425-prime-connection.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-425-prime-connection.english.md @@ -37,7 +37,7 @@ Find F(107). ```yml tests: - text: euler425() should return 46479497324. - testString: 'assert.strictEqual(euler425(), 46479497324, ''euler425() should return 46479497324.'');' + testString: 'assert.strictEqual(euler425(), 46479497324, "euler425() should return 46479497324.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-426-box-ball-system.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-426-box-ball-system.english.md index d2bcf1b050..3304bebc03 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-426-box-ball-system.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-426-box-ball-system.english.md @@ -49,7 +49,7 @@ Give as your answer the sum of the squares of the elements of the final state. F ```yml tests: - text: euler426() should return 31591886008. - testString: 'assert.strictEqual(euler426(), 31591886008, ''euler426() should return 31591886008.'');' + testString: 'assert.strictEqual(euler426(), 31591886008, "euler426() should return 31591886008.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-427-n-sequences.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-427-n-sequences.english.md index fa40cbd7dc..d9595f5a79 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-427-n-sequences.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-427-n-sequences.english.md @@ -30,7 +30,7 @@ Find f(7 500 000) mod 1 000 000 009. ```yml tests: - text: euler427() should return 97138867. - testString: 'assert.strictEqual(euler427(), 97138867, ''euler427() should return 97138867.'');' + testString: 'assert.strictEqual(euler427(), 97138867, "euler427() should return 97138867.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-428-necklace-of-circles.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-428-necklace-of-circles.english.md index 00c55eddb7..822d767000 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-428-necklace-of-circles.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-428-necklace-of-circles.english.md @@ -33,7 +33,7 @@ Find T(1 000 000 000). ```yml tests: - text: necklace(1000000000) should return 747215561862. - testString: 'assert.strictEqual(necklace(1000000000), 747215561862, ''necklace(1000000000) should return 747215561862.'');' + testString: 'assert.strictEqual(necklace(1000000000), 747215561862, "necklace(1000000000) should return 747215561862.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-429-sum-of-squares-of-unitary-divisors.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-429-sum-of-squares-of-unitary-divisors.english.md index c8072e2a0a..fdd744a147 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-429-sum-of-squares-of-unitary-divisors.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-429-sum-of-squares-of-unitary-divisors.english.md @@ -28,7 +28,7 @@ Find S(100 000 000!) modulo 1 000 000 009. ```yml tests: - text: euler429() should return 98792821. - testString: 'assert.strictEqual(euler429(), 98792821, ''euler429() should return 98792821.'');' + testString: 'assert.strictEqual(euler429(), 98792821, "euler429() should return 98792821.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-43-sub-string-divisibility.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-43-sub-string-divisibility.english.md index d477ed8110..29aa0b88c2 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-43-sub-string-divisibility.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-43-sub-string-divisibility.english.md @@ -29,7 +29,7 @@ Find the numbers of all 0 to 9 pandigital numbers with this property. ```yml tests: - text: 'substringDivisibility() should return [ 1430952867, 1460357289, 1406357289, 4130952867, 4160357289, 4106357289 ].' - testString: 'assert.deepEqual(substringDivisibility(), [ 1430952867, 1460357289, 1406357289, 4130952867, 4160357289, 4106357289 ], ''substringDivisibility() should return [ 1430952867, 1460357289, 1406357289, 4130952867, 4160357289, 4106357289 ].'');' + testString: 'assert.deepEqual(substringDivisibility(), [ 1430952867, 1460357289, 1406357289, 4130952867, 4160357289, 4106357289 ], "substringDivisibility() should return [ 1430952867, 1460357289, 1406357289, 4130952867, 4160357289, 4106357289 ].");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-430-range-flips.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-430-range-flips.english.md index f6b233f3ba..2c1d084f1a 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-430-range-flips.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-430-range-flips.english.md @@ -34,7 +34,7 @@ Give your answer rounded to 2 decimal places behind the decimal point. ```yml tests: - text: euler430() should return 5000624921.38. - testString: 'assert.strictEqual(euler430(), 5000624921.38, ''euler430() should return 5000624921.38.'');' + testString: 'assert.strictEqual(euler430(), 5000624921.38, "euler430() should return 5000624921.38.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-431-square-space-silo.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-431-square-space-silo.english.md index 5035041884..637a95c9c3 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-431-square-space-silo.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-431-square-space-silo.english.md @@ -31,7 +31,7 @@ If Quick thinking Quentin is to satisfy frustratingly fussy Fred the farmer's ap ```yml tests: - text: euler431() should return 23.386029052. - testString: 'assert.strictEqual(euler431(), 23.386029052, ''euler431() should return 23.386029052.'');' + testString: 'assert.strictEqual(euler431(), 23.386029052, "euler431() should return 23.386029052.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-432-totient-sum.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-432-totient-sum.english.md index 37ad36f28c..7ae1f5ac9e 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-432-totient-sum.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-432-totient-sum.english.md @@ -7,7 +7,7 @@ title: 'Problem 432: Totient sum' ## Description
Let S(n,m) = ∑φ(n × i) for 1 ≤ i ≤ m. (φ is Euler's totient function) -You are given that S(510510,106 )= 45480596821125120. +You are given that S(510510,106 )= 45480596821125120. Find S(510510,1011). @@ -25,7 +25,7 @@ Give the last 9 digits of your answer. ```yml tests: - text: euler432() should return 754862080. - testString: 'assert.strictEqual(euler432(), 754862080, ''euler432() should return 754862080.'');' + testString: 'assert.strictEqual(euler432(), 754862080, "euler432() should return 754862080.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-433-steps-in-euclids-algorithm.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-433-steps-in-euclids-algorithm.english.md index c003c42f62..c345ba6ed4 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-433-steps-in-euclids-algorithm.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-433-steps-in-euclids-algorithm.english.md @@ -1,7 +1,7 @@ --- id: 5900f51d1000cf542c51002f challengeType: 5 -title: 'Problem 433: Steps in Euclid''s algorithm' +title: 'Problem 433: Steps in Euclid"s algorithm' --- ## Description @@ -31,7 +31,7 @@ Find S(5·106). ```yml tests: - text: euler433() should return 326624372659664. - testString: 'assert.strictEqual(euler433(), 326624372659664, ''euler433() should return 326624372659664.'');' + testString: 'assert.strictEqual(euler433(), 326624372659664, "euler433() should return 326624372659664.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-434-rigid-graphs.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-434-rigid-graphs.english.md index e0172472bb..35975b5b79 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-434-rigid-graphs.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-434-rigid-graphs.english.md @@ -16,7 +16,7 @@ The grid graphs embedded in the Euclidean plane are not rigid, as the following However, one can make them rigid by adding diagonal edges to the cells. For example, for the 2x3 grid graph, there are 19 ways to make the graph rigid: Note that for the purposes of this problem, we do not consider changing the orientation of a diagonal edge or adding both diagonal edges to a cell as a different way of making a grid graph rigid. -Let R(m,n) be the number of ways to make the m × n grid graph rigid. +Let R(m,n) be the number of ways to make the m × n grid graph rigid. E.g. R(2,3) = 19 and R(5,5) = 23679901 Define S(N) as ∑R(i,j) for 1 ≤ i, j ≤ N. @@ -35,7 +35,7 @@ Find S(100), give your answer modulo 1000000033 ```yml tests: - text: euler434() should return 863253606. - testString: 'assert.strictEqual(euler434(), 863253606, ''euler434() should return 863253606.'');' + testString: 'assert.strictEqual(euler434(), 863253606, "euler434() should return 863253606.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-435-polynomials-of-fibonacci-numbers.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-435-polynomials-of-fibonacci-numbers.english.md index 495f2b1df6..44f9b359d7 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-435-polynomials-of-fibonacci-numbers.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-435-polynomials-of-fibonacci-numbers.english.md @@ -23,7 +23,7 @@ Let n = 1015. Find the sum [∑0≤x≤100 Fn(x)] mod 1307674368000 (= 15!). ```yml tests: - text: euler435() should return 252541322550. - testString: 'assert.strictEqual(euler435(), 252541322550, ''euler435() should return 252541322550.'');' + testString: 'assert.strictEqual(euler435(), 252541322550, "euler435() should return 252541322550.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-436-unfair-wager.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-436-unfair-wager.english.md index 02a68359a5..52f73fbf3d 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-436-unfair-wager.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-436-unfair-wager.english.md @@ -34,7 +34,7 @@ Give your answer rounded to 10 places behind the decimal point in the form 0.abc ```yml tests: - text: euler436() should return 0.5276662759. - testString: 'assert.strictEqual(euler436(), 0.5276662759, ''euler436() should return 0.5276662759.'');' + testString: 'assert.strictEqual(euler436(), 0.5276662759, "euler436() should return 0.5276662759.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-437-fibonacci-primitive-roots.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-437-fibonacci-primitive-roots.english.md index f4814314d1..3045db4a80 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-437-fibonacci-primitive-roots.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-437-fibonacci-primitive-roots.english.md @@ -38,7 +38,7 @@ Find the sum of the primes less than 100,000,000 with at least one Fibonacci pri ```yml tests: - text: euler437() should return 74204709657207. - testString: 'assert.strictEqual(euler437(), 74204709657207, ''euler437() should return 74204709657207.'');' + testString: 'assert.strictEqual(euler437(), 74204709657207, "euler437() should return 74204709657207.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-438-integer-part-of-polynomial-equations-solutions.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-438-integer-part-of-polynomial-equations-solutions.english.md index e3078bb1ca..3a76b605e0 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-438-integer-part-of-polynomial-equations-solutions.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-438-integer-part-of-polynomial-equations-solutions.english.md @@ -1,7 +1,7 @@ --- id: 5900f5231000cf542c510034 challengeType: 5 -title: 'Problem 438: Integer part of polynomial equation''s solutions' +title: 'Problem 438: Integer part of polynomial equation"s solutions' --- ## Description @@ -32,7 +32,7 @@ Find ∑S(t) for n = 7. ```yml tests: - text: euler438() should return 2046409616809. - testString: 'assert.strictEqual(euler438(), 2046409616809, ''euler438() should return 2046409616809.'');' + testString: 'assert.strictEqual(euler438(), 2046409616809, "euler438() should return 2046409616809.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-439-sum-of-sum-of-divisors.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-439-sum-of-sum-of-divisors.english.md index 03979e4570..f7e741804d 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-439-sum-of-sum-of-divisors.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-439-sum-of-sum-of-divisors.english.md @@ -25,7 +25,7 @@ Find S(1011) mod 109. ```yml tests: - text: euler439() should return 968697378. - testString: 'assert.strictEqual(euler439(), 968697378, ''euler439() should return 968697378.'');' + testString: 'assert.strictEqual(euler439(), 968697378, "euler439() should return 968697378.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-44-pentagon-numbers.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-44-pentagon-numbers.english.md index b96faba3c2..d5db372b05 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-44-pentagon-numbers.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-44-pentagon-numbers.english.md @@ -23,7 +23,7 @@ Find the pair of pentagonal numbers, Pj and Pk, for which ```yml tests: - text: pentagonNumbers() should return 5482660. - testString: 'assert.strictEqual(pentagonNumbers(), 5482660, ''pentagonNumbers() should return 5482660.'');' + testString: 'assert.strictEqual(pentagonNumbers(), 5482660, "pentagonNumbers() should return 5482660.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-440-gcd-and-tiling.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-440-gcd-and-tiling.english.md index af17264628..5c5509eccd 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-440-gcd-and-tiling.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-440-gcd-and-tiling.english.md @@ -34,7 +34,7 @@ Find S(2000) mod 987 898 789. ```yml tests: - text: euler440() should return 970746056. - testString: 'assert.strictEqual(euler440(), 970746056, ''euler440() should return 970746056.'');' + testString: 'assert.strictEqual(euler440(), 970746056, "euler440() should return 970746056.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-441-the-inverse-summation-of-coprime-couples.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-441-the-inverse-summation-of-coprime-couples.english.md index 95485ec372..6df6f66f66 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-441-the-inverse-summation-of-coprime-couples.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-441-the-inverse-summation-of-coprime-couples.english.md @@ -30,7 +30,7 @@ Find S(107). Give your answer rounded to four decimal places. ```yml tests: - text: euler441() should return 5000088.8395. - testString: 'assert.strictEqual(euler441(), 5000088.8395, ''euler441() should return 5000088.8395.'');' + testString: 'assert.strictEqual(euler441(), 5000088.8395, "euler441() should return 5000088.8395.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-442-eleven-free-integers.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-442-eleven-free-integers.english.md index 588b7c620a..823a0e2513 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-442-eleven-free-integers.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-442-eleven-free-integers.english.md @@ -26,7 +26,7 @@ Find E(1018). ```yml tests: - text: euler442() should return 1295552661530920200. - testString: 'assert.strictEqual(euler442(), 1295552661530920200, ''euler442() should return 1295552661530920200.'');' + testString: 'assert.strictEqual(euler442(), 1295552661530920200, "euler442() should return 1295552661530920200.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-443-gcd-sequence.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-443-gcd-sequence.english.md index 9a3afee734..253afdcf70 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-443-gcd-sequence.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-443-gcd-sequence.english.md @@ -32,7 +32,7 @@ Find g(1015). ```yml tests: - text: euler443() should return 2744233049300770. - testString: 'assert.strictEqual(euler443(), 2744233049300770, ''euler443() should return 2744233049300770.'');' + testString: 'assert.strictEqual(euler443(), 2744233049300770, "euler443() should return 2744233049300770.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-444-the-roundtable-lottery.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-444-the-roundtable-lottery.english.md index bd10682720..40db2a9e35 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-444-the-roundtable-lottery.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-444-the-roundtable-lottery.english.md @@ -15,7 +15,7 @@ An arbitrary person is chosen to be the first player. Going around the table, ea The game ends once all tickets have been scratched. All players still remaining at the table must leave with their currently-held tickets. -Assume that each player uses the optimal strategy for maximizing the expected value of his ticket winnings. +Assume that each player uses the optimal strategy for maximizing the expected value of his ticket winnings. Let E(p) represent the expected number of players left at the table when the game ends in a game consisting of p players (e.g. E(111) = 5.2912 when rounded to 5 significant digits). @@ -36,7 +36,7 @@ Find S20(1014) and write the answer in scientific notation rounded to 10 signifi ```yml tests: - text: euler444() should return 1.200856722e+263. - testString: 'assert.strictEqual(euler444(), 1.200856722e+263, ''euler444() should return 1.200856722e+263.'');' + testString: 'assert.strictEqual(euler444(), 1.200856722e+263, "euler444() should return 1.200856722e+263.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-445-retractions-a.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-445-retractions-a.english.md index ce4f510f5f..f8c5a0478e 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-445-retractions-a.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-445-retractions-a.english.md @@ -6,7 +6,7 @@ title: 'Problem 445: Retractions A' ## Description
-For every integer n>1, the family of functions fn,a,b is defined +For every integer n>1, the family of functions fn,a,b is defined by fn,a,b(x)≡ax+b mod n for a,b,x integer and 0euler445() should return 659104042. - testString: 'assert.strictEqual(euler445(), 659104042, ''euler445() should return 659104042.'');' + testString: 'assert.strictEqual(euler445(), 659104042, "euler445() should return 659104042.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-446-retractions-b.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-446-retractions-b.english.md index 572dfe7e7f..2741949453 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-446-retractions-b.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-446-retractions-b.english.md @@ -6,13 +6,13 @@ title: 'Problem 446: Retractions B' ## Description
-For every integer n>1, the family of functions fn,a,b is defined +For every integer n>1, the family of functions fn,a,b is defined by fn,a,b(x)≡ax+b mod n for a,b,x integer and 0euler446() should return 907803852. - testString: 'assert.strictEqual(euler446(), 907803852, ''euler446() should return 907803852.'');' + testString: 'assert.strictEqual(euler446(), 907803852, "euler446() should return 907803852.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-447-retractions-c.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-447-retractions-c.english.md index 98e55b8902..5f9ac3e256 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-447-retractions-c.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-447-retractions-c.english.md @@ -6,7 +6,7 @@ title: 'Problem 447: Retractions C' ## Description
-For every integer n>1, the family of functions fn,a,b is defined +For every integer n>1, the family of functions fn,a,b is defined by fn,a,b(x)≡ax+b mod n for a,b,x integer and 0euler447() should return 530553372. - testString: 'assert.strictEqual(euler447(), 530553372, ''euler447() should return 530553372.'');' + testString: 'assert.strictEqual(euler447(), 530553372, "euler447() should return 530553372.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-448-average-least-common-multiple.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-448-average-least-common-multiple.english.md index aac557910a..01b1c70702 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-448-average-least-common-multiple.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-448-average-least-common-multiple.english.md @@ -8,7 +8,7 @@ title: 'Problem 448: Average least common multiple'
The function lcm(a,b) denotes the least common multiple of a and b. Let A(n) be the average of the values of lcm(n,i) for 1≤i≤n. -E.g: A(2)=(2+2)/2=2 and A(10)=(10+10+30+20+10+30+70+40+90+10)/10=32. +E.g: A(2)=(2+2)/2=2 and A(10)=(10+10+30+20+10+30+70+40+90+10)/10=32. Let S(n)=∑A(k) for 1≤k≤n. S(100)=122726. @@ -28,7 +28,7 @@ Find S(99999999019) mod 999999017. ```yml tests: - text: euler448() should return 106467648. - testString: 'assert.strictEqual(euler448(), 106467648, ''euler448() should return 106467648.'');' + testString: 'assert.strictEqual(euler448(), 106467648, "euler448() should return 106467648.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-449-chocolate-covered-candy.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-449-chocolate-covered-candy.english.md index bdceb2e52d..0a43a7fdc7 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-449-chocolate-covered-candy.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-449-chocolate-covered-candy.english.md @@ -10,7 +10,7 @@ Phil the confectioner is making a new batch of chocolate covered candy. Each can Phil wants to know how much chocolate is needed to cover one candy centre with a uniform coat of chocolate one millimeter thick. -If a=1 mm and b=1 mm, the amount of chocolate required is +If a=1 mm and b=1 mm, the amount of chocolate required is 283 π mm3 @@ -32,7 +32,7 @@ Find the amount of chocolate in mm3 required if a=3 mm and b=1 mm. Give your ans ```yml tests: - text: euler449() should return 103.37870096. - testString: 'assert.strictEqual(euler449(), 103.37870096, ''euler449() should return 103.37870096.'');' + testString: 'assert.strictEqual(euler449(), 103.37870096, "euler449() should return 103.37870096.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-45-triangular-pentagonal-and-hexagonal.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-45-triangular-pentagonal-and-hexagonal.english.md index 3cda54c6af..6b3f68f9f3 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-45-triangular-pentagonal-and-hexagonal.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-45-triangular-pentagonal-and-hexagonal.english.md @@ -25,7 +25,7 @@ Find the next triangle number that is also pentagonal and hexagonal. ```yml tests: - text: triPentaHexa(40756) should return 1533776805. - testString: 'assert.strictEqual(triPentaHexa(40756), 1533776805, ''triPentaHexa(40756) should return 1533776805.'');' + testString: 'assert.strictEqual(triPentaHexa(40756), 1533776805, "triPentaHexa(40756) should return 1533776805.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-450-hypocycloid-and-lattice-points.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-450-hypocycloid-and-lattice-points.english.md index 35658d90cf..12209e42b2 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-450-hypocycloid-and-lattice-points.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-450-hypocycloid-and-lattice-points.english.md @@ -48,7 +48,7 @@ Find T(106). ```yml tests: - text: euler450() should return 583333163984220900. - testString: 'assert.strictEqual(euler450(), 583333163984220900, ''euler450() should return 583333163984220900.'');' + testString: 'assert.strictEqual(euler450(), 583333163984220900, "euler450() should return 583333163984220900.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-451-modular-inverses.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-451-modular-inverses.english.md index a1889c6e3b..40b4b96b7a 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-451-modular-inverses.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-451-modular-inverses.english.md @@ -8,7 +8,7 @@ title: 'Problem 451: Modular inverses'
Consider the number 15. There are eight positive numbers less than 15 which are coprime to 15: 1, 2, 4, 7, 8, 11, 13, 14. -The modular inverses of these numbers modulo 15 are: 1, 8, 4, 13, 2, 11, 7, 14 +The modular inverses of these numbers modulo 15 are: 1, 8, 4, 13, 2, 11, 7, 14 because 1*1 mod 15=1 2*8=16 mod 15=1 @@ -35,7 +35,7 @@ Find ∑I(n) for 3≤n≤2·107 ```yml tests: - text: euler451() should return 153651073760956. - testString: 'assert.strictEqual(euler451(), 153651073760956, ''euler451() should return 153651073760956.'');' + testString: 'assert.strictEqual(euler451(), 153651073760956, "euler451() should return 153651073760956.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-452-long-products.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-452-long-products.english.md index 768d98f043..2b6a0842b1 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-452-long-products.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-452-long-products.english.md @@ -23,7 +23,7 @@ Find F(109, 109) mod 1 234 567 891. ```yml tests: - text: euler452() should return 345558983. - testString: 'assert.strictEqual(euler452(), 345558983, ''euler452() should return 345558983.'');' + testString: 'assert.strictEqual(euler452(), 345558983, "euler452() should return 345558983.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-453-lattice-quadrilaterals.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-453-lattice-quadrilaterals.english.md index 40258677bb..913f75a8a1 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-453-lattice-quadrilaterals.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-453-lattice-quadrilaterals.english.md @@ -28,7 +28,7 @@ Find Q(12345, 6789) mod 135707531. ```yml tests: - text: euler453() should return 104354107. - testString: 'assert.strictEqual(euler453(), 104354107, ''euler453() should return 104354107.'');' + testString: 'assert.strictEqual(euler453(), 104354107, "euler453() should return 104354107.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-454-diophantine-reciprocals-iii.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-454-diophantine-reciprocals-iii.english.md index e49348fb93..1be6a554ee 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-454-diophantine-reciprocals-iii.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-454-diophantine-reciprocals-iii.english.md @@ -9,9 +9,9 @@ title: 'Problem 454: Diophantine reciprocals III' In the following equation x, y, and n are positive integers. 1x - + + + 1y - = + = 1n For a limit L we define F(L) as the number of solutions which satisfy x < y ≤ L. @@ -31,7 +31,7 @@ Find F(1012). ```yml tests: - text: euler454() should return 5435004633092. - testString: 'assert.strictEqual(euler454(), 5435004633092, ''euler454() should return 5435004633092.'');' + testString: 'assert.strictEqual(euler454(), 5435004633092, "euler454() should return 5435004633092.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-455-powers-with-trailing-digits.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-455-powers-with-trailing-digits.english.md index 78894428b7..7d6ee76d77 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-455-powers-with-trailing-digits.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-455-powers-with-trailing-digits.english.md @@ -10,7 +10,7 @@ Let f(n) be the largest positive integer x less than 109 such that the last 9 di For example: -f(4) = 411728896 (4411728896 = ...490411728896) +f(4) = 411728896 (4411728896 = ...490411728896) f(10) = 0 f(157) = 743757 (157743757 = ...567000743757) Σf(n), 2 ≤ n ≤ 103 = 442530011399 @@ -28,7 +28,7 @@ Find Σf(n), 2 ≤ n ≤ 106. ```yml tests: - text: euler455() should return 450186511399999. - testString: 'assert.strictEqual(euler455(), 450186511399999, ''euler455() should return 450186511399999.'');' + testString: 'assert.strictEqual(euler455(), 450186511399999, "euler455() should return 450186511399999.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-456-triangles-containing-the-origin-ii.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-456-triangles-containing-the-origin-ii.english.md index 8549323068..8c4ee752b5 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-456-triangles-containing-the-origin-ii.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-456-triangles-containing-the-origin-ii.english.md @@ -35,7 +35,7 @@ Find C(2 000 000). ```yml tests: - text: euler456() should return 333333208685971500. - testString: 'assert.strictEqual(euler456(), 333333208685971500, ''euler456() should return 333333208685971500.'');' + testString: 'assert.strictEqual(euler456(), 333333208685971500, "euler456() should return 333333208685971500.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-457-a-polynomial-modulo-the-square-of-a-prime.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-457-a-polynomial-modulo-the-square-of-a-prime.english.md index 05ee0d79cd..f5966ef74e 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-457-a-polynomial-modulo-the-square-of-a-prime.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-457-a-polynomial-modulo-the-square-of-a-prime.english.md @@ -28,7 +28,7 @@ Find SR(107). ```yml tests: - text: euler457() should return 2647787126797397000. - testString: 'assert.strictEqual(euler457(), 2647787126797397000, ''euler457() should return 2647787126797397000.'');' + testString: 'assert.strictEqual(euler457(), 2647787126797397000, "euler457() should return 2647787126797397000.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-458-permutations-of-project.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-458-permutations-of-project.english.md index ad7ed4e31a..7e9ca73edd 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-458-permutations-of-project.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-458-permutations-of-project.english.md @@ -26,7 +26,7 @@ Find T(1012). Give the last 9 digits of your answer. ```yml tests: - text: euler458() should return 423341841. - testString: 'assert.strictEqual(euler458(), 423341841, ''euler458() should return 423341841.'');' + testString: 'assert.strictEqual(euler458(), 423341841, "euler458() should return 423341841.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-459-flipping-game.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-459-flipping-game.english.md index d779238227..d921316b18 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-459-flipping-game.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-459-flipping-game.english.md @@ -40,7 +40,7 @@ Find W(106). ```yml tests: - text: euler459() should return 3996390106631. - testString: 'assert.strictEqual(euler459(), 3996390106631, ''euler459() should return 3996390106631.'');' + testString: 'assert.strictEqual(euler459(), 3996390106631, "euler459() should return 3996390106631.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-46-goldbachs-other-conjecture.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-46-goldbachs-other-conjecture.english.md index 4f21c15e0e..bb0ce70dc9 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-46-goldbachs-other-conjecture.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-46-goldbachs-other-conjecture.english.md @@ -1,7 +1,7 @@ --- id: 5900f39a1000cf542c50fead challengeType: 5 -title: 'Problem 46: Goldbach''s other conjecture' +title: 'Problem 46: Goldbach"s other conjecture' --- ## Description @@ -28,7 +28,7 @@ What is the smallest odd composite that cannot be written as the sum of a prime ```yml tests: - text: goldbachsOtherConjecture() should return 5777. - testString: 'assert.strictEqual(goldbachsOtherConjecture(), 5777, ''goldbachsOtherConjecture() should return 5777.'');' + testString: 'assert.strictEqual(goldbachsOtherConjecture(), 5777, "goldbachsOtherConjecture() should return 5777.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-460-an-ant-on-the-move.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-460-an-ant-on-the-move.english.md index 7bd6ac233b..2f18cc2b67 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-460-an-ant-on-the-move.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-460-an-ant-on-the-move.english.md @@ -40,7 +40,7 @@ Find F(10000). Give your answer rounded to nine decimal places. ```yml tests: - text: euler460() should return 18.420738199. - testString: 'assert.strictEqual(euler460(), 18.420738199, ''euler460() should return 18.420738199.'');' + testString: 'assert.strictEqual(euler460(), 18.420738199, "euler460() should return 18.420738199.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-461-almost-pi.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-461-almost-pi.english.md index 82b566412c..ab72c8b89a 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-461-almost-pi.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-461-almost-pi.english.md @@ -26,7 +26,7 @@ Find g(10000). ```yml tests: - text: euler461() should return 159820276. - testString: 'assert.strictEqual(euler461(), 159820276, ''euler461() should return 159820276.'');' + testString: 'assert.strictEqual(euler461(), 159820276, "euler461() should return 159820276.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-462-permutation-of-3-smooth-numbers.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-462-permutation-of-3-smooth-numbers.english.md index 6291158b24..ef3d4a657b 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-462-permutation-of-3-smooth-numbers.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-462-permutation-of-3-smooth-numbers.english.md @@ -34,7 +34,7 @@ When giving your answer, use a lowercase e to separate mantissa and exponent. E. ```yml tests: - text: euler462() should return Infinity. - testString: 'assert.strictEqual(euler462(), Infinity, ''euler462() should return Infinity.'');' + testString: 'assert.strictEqual(euler462(), Infinity, "euler462() should return Infinity.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-463-a-weird-recurrence-relation.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-463-a-weird-recurrence-relation.english.md index f596d13bbd..33031aed1b 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-463-a-weird-recurrence-relation.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-463-a-weird-recurrence-relation.english.md @@ -29,7 +29,7 @@ Find $S(3^{37})$. Give the last 9 digits of your answer. ```yml tests: - text: euler463() should return 808981553. - testString: 'assert.strictEqual(euler463(), 808981553, ''euler463() should return 808981553.'');' + testString: 'assert.strictEqual(euler463(), 808981553, "euler463() should return 808981553.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-464-mbius-function-and-intervals.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-464-mbius-function-and-intervals.english.md index d397ff6be9..00c82c4d8a 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-464-mbius-function-and-intervals.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-464-mbius-function-and-intervals.english.md @@ -39,7 +39,7 @@ Find C(20 000 000). ```yml tests: - text: euler464() should return 198775297232878. - testString: 'assert.strictEqual(euler464(), 198775297232878, ''euler464() should return 198775297232878.'');' + testString: 'assert.strictEqual(euler464(), 198775297232878, "euler464() should return 198775297232878.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-465-polar-polygons.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-465-polar-polygons.english.md index 3862649d84..6c3193c609 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-465-polar-polygons.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-465-polar-polygons.english.md @@ -36,7 +36,7 @@ Find P(713) mod 1 000 000 007. ```yml tests: - text: euler465() should return 585965659. - testString: 'assert.strictEqual(euler465(), 585965659, ''euler465() should return 585965659.'');' + testString: 'assert.strictEqual(euler465(), 585965659, "euler465() should return 585965659.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-466-distinct-terms-in-a-multiplication-table.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-466-distinct-terms-in-a-multiplication-table.english.md index d818e81197..fa665ed89f 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-466-distinct-terms-in-a-multiplication-table.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-466-distinct-terms-in-a-multiplication-table.english.md @@ -35,7 +35,7 @@ Find P(64,1016). ```yml tests: - text: euler466() should return 258381958195474750. - testString: 'assert.strictEqual(euler466(), 258381958195474750, ''euler466() should return 258381958195474750.'');' + testString: 'assert.strictEqual(euler466(), 258381958195474750, "euler466() should return 258381958195474750.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-467-superinteger.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-467-superinteger.english.md index 6f77315ca1..7e9cbe1ee9 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-467-superinteger.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-467-superinteger.english.md @@ -38,7 +38,7 @@ Find f(10 000) mod 1 000 000 007. ```yml tests: - text: euler467() should return 775181359. - testString: 'assert.strictEqual(euler467(), 775181359, ''euler467() should return 775181359.'');' + testString: 'assert.strictEqual(euler467(), 775181359, "euler467() should return 775181359.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-468-smooth-divisors-of-binomial-coefficients.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-468-smooth-divisors-of-binomial-coefficients.english.md index b2f153c5ec..8a5e996b8b 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-468-smooth-divisors-of-binomial-coefficients.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-468-smooth-divisors-of-binomial-coefficients.english.md @@ -34,7 +34,7 @@ Find F(11 111 111) mod 1 000 000 993. ```yml tests: - text: euler468() should return 852950321. - testString: 'assert.strictEqual(euler468(), 852950321, ''euler468() should return 852950321.'');' + testString: 'assert.strictEqual(euler468(), 852950321, "euler468() should return 852950321.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-469-empty-chairs.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-469-empty-chairs.english.md index bd3b0d0a80..839dfa1b1a 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-469-empty-chairs.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-469-empty-chairs.english.md @@ -30,7 +30,7 @@ Find E(1018). Give your answer rounded to fourteen decimal places in the form 0. ```yml tests: - text: euler469() should return 0.56766764161831. - testString: 'assert.strictEqual(euler469(), 0.56766764161831, ''euler469() should return 0.56766764161831.'');' + testString: 'assert.strictEqual(euler469(), 0.56766764161831, "euler469() should return 0.56766764161831.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-47-distinct-primes-factors.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-47-distinct-primes-factors.english.md index 07547ffe27..8a0d9904d7 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-47-distinct-primes-factors.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-47-distinct-primes-factors.english.md @@ -27,11 +27,11 @@ Find the first four consecutive integers to have four distinct prime factors eac ```yml tests: - text: 'distinctPrimeFactors(2, 2) should return 14.' - testString: 'assert.strictEqual(distinctPrimeFactors(2, 2), 14, ''distinctPrimeFactors(2, 2) should return 14.'');' + testString: 'assert.strictEqual(distinctPrimeFactors(2, 2), 14, "distinctPrimeFactors(2, 2) should return 14.");' - text: 'distinctPrimeFactors(3, 3) should return 644.' - testString: 'assert.strictEqual(distinctPrimeFactors(3, 3), 644, ''distinctPrimeFactors(3, 3) should return 644.'');' + testString: 'assert.strictEqual(distinctPrimeFactors(3, 3), 644, "distinctPrimeFactors(3, 3) should return 644.");' - text: 'distinctPrimeFactors(4, 4) should return 134043.' - testString: 'assert.strictEqual(distinctPrimeFactors(4, 4), 134043, ''distinctPrimeFactors(4, 4) should return 134043.'');' + testString: 'assert.strictEqual(distinctPrimeFactors(4, 4), 134043, "distinctPrimeFactors(4, 4) should return 134043.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-470-super-ramvok.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-470-super-ramvok.english.md index 60892312ad..4a319d46df 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-470-super-ramvok.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-470-super-ramvok.english.md @@ -32,7 +32,7 @@ Calculate F(20), rounded to the nearest integer. ```yml tests: - text: euler470() should return 147668794. - testString: 'assert.strictEqual(euler470(), 147668794, ''euler470() should return 147668794.'');' + testString: 'assert.strictEqual(euler470(), 147668794, "euler470() should return 147668794.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-471-triangle-inscribed-in-ellipse.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-471-triangle-inscribed-in-ellipse.english.md index b98b6cad46..c6c81b9b14 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-471-triangle-inscribed-in-ellipse.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-471-triangle-inscribed-in-ellipse.english.md @@ -29,7 +29,7 @@ For G(10) the answer would have been 2.059722222e1. ```yml tests: - text: euler471() should return 1.895093981e+31. - testString: 'assert.strictEqual(euler471(), 1.895093981e+31, ''euler471() should return 1.895093981e+31.'');' + testString: 'assert.strictEqual(euler471(), 1.895093981e+31, "euler471() should return 1.895093981e+31.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-472-comfortable-distance-ii.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-472-comfortable-distance-ii.english.md index 30a450efd7..008ed29215 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-472-comfortable-distance-ii.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-472-comfortable-distance-ii.english.md @@ -37,7 +37,7 @@ Find ∑f(N) for 1 ≤ N ≤ 1012. Give the last 8 digits of your answer. ```yml tests: - text: euler472() should return 73811586. - testString: 'assert.strictEqual(euler472(), 73811586, ''euler472() should return 73811586.'');' + testString: 'assert.strictEqual(euler472(), 73811586, "euler472() should return 73811586.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-473-phigital-number-base.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-473-phigital-number-base.english.md index 17e95d2a2b..17be0286f8 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-473-phigital-number-base.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-473-phigital-number-base.english.md @@ -10,13 +10,13 @@ Let $\varphi$ be the golden ratio: $\varphi=\frac{1+\sqrt{5}}{2}.$ Remarkably it is possible to write every positive integer as a sum of powers of $\varphi$ even if we require that every power of $\varphi$ is used at most once in this sum. Even then this representation is not unique. We can make it unique by requiring that no powers with consecutive exponents are used and that the representation is finite. -E.g: +E.g: $2=\varphi+\varphi^{-2}$ and $3=\varphi^{2}+\varphi^{-2}$ To represent this sum of powers of $\varphi$ we use a string of 0's and 1's with a point to indicate where the negative exponents start. We call this the representation in the phigital numberbase. -So $1=1_{\varphi}$, $2=10.01_{\varphi}$, $3=100.01_{\varphi}$ and $14=100100.001001_{\varphi}$. +So $1=1_{\varphi}$, $2=10.01_{\varphi}$, $3=100.01_{\varphi}$ and $14=100100.001001_{\varphi}$. The strings representing 1, 2 and 14 in the phigital number base are palindromic, while the string representing 3 is not. (the phigital point is not the middle character). @@ -37,7 +37,7 @@ Find the sum of the positive integers not exceeding $10^{10}$ whose phigital rep ```yml tests: - text: euler473() should return 35856681704365. - testString: 'assert.strictEqual(euler473(), 35856681704365, ''euler473() should return 35856681704365.'');' + testString: 'assert.strictEqual(euler473(), 35856681704365, "euler473() should return 35856681704365.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-474-last-digits-of-divisors.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-474-last-digits-of-divisors.english.md index 4e4f865de2..0bdf095cf9 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-474-last-digits-of-divisors.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-474-last-digits-of-divisors.english.md @@ -27,7 +27,7 @@ Find F(106!, 65432) modulo (1016 + 61). ```yml tests: - text: euler474() should return 9690646731515010. - testString: 'assert.strictEqual(euler474(), 9690646731515010, ''euler474() should return 9690646731515010.'');' + testString: 'assert.strictEqual(euler474(), 9690646731515010, "euler474() should return 9690646731515010.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-475-music-festival.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-475-music-festival.english.md index 7c9ef9c52a..8553b4b92a 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-475-music-festival.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-475-music-festival.english.md @@ -27,7 +27,7 @@ Find f(600) mod 1 000 000 007. ```yml tests: - text: euler475() should return 75780067. - testString: 'assert.strictEqual(euler475(), 75780067, ''euler475() should return 75780067.'');' + testString: 'assert.strictEqual(euler475(), 75780067, "euler475() should return 75780067.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-476-circle-packing-ii.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-476-circle-packing-ii.english.md index 3507182a99..1c46078d85 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-476-circle-packing-ii.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-476-circle-packing-ii.english.md @@ -23,7 +23,7 @@ Find S(1803) rounded to 5 decimal places behind the decimal point. ```yml tests: - text: euler476() should return 110242.87794. - testString: 'assert.strictEqual(euler476(), 110242.87794, ''euler476() should return 110242.87794.'');' + testString: 'assert.strictEqual(euler476(), 110242.87794, "euler476() should return 110242.87794.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-477-number-sequence-game.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-477-number-sequence-game.english.md index ac95d74e11..7ce03fcec0 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-477-number-sequence-game.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-477-number-sequence-game.english.md @@ -34,7 +34,7 @@ Find F(108). ```yml tests: - text: euler477() should return 25044905874565164. - testString: 'assert.strictEqual(euler477(), 25044905874565164, ''euler477() should return 25044905874565164.'');' + testString: 'assert.strictEqual(euler477(), 25044905874565164, "euler477() should return 25044905874565164.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-478-mixtures.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-478-mixtures.english.md index 0cbb666926..202e8a14bf 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-478-mixtures.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-478-mixtures.english.md @@ -19,12 +19,12 @@ However, with the same three mixtures, it is impossible to form the ratio (3 : Let n be a positive integer. Suppose that for every triple of integers (a, b, c) with 0 ≤ a, b, c ≤ n and gcd(a, b, c) = 1, we have a mixture with ratio (a : b : c). Let M(n) be the set of all such mixtures. For example, M(2) contains the 19 mixtures with the following ratios: -{(0 : 0 : 1), (0 : 1 : 0), (0 : 1 : 1), (0 : 1 : 2), (0 : 2 : 1), -(1 : 0 : 0), (1 : 0 : 1), (1 : 0 : 2), (1 : 1 : 0), (1 : 1 : 1), -(1 : 1 : 2), (1 : 2 : 0), (1 : 2 : 1), (1 : 2 : 2), (2 : 0 : 1), +{(0 : 0 : 1), (0 : 1 : 0), (0 : 1 : 1), (0 : 1 : 2), (0 : 2 : 1), +(1 : 0 : 0), (1 : 0 : 1), (1 : 0 : 2), (1 : 1 : 0), (1 : 1 : 1), +(1 : 1 : 2), (1 : 2 : 0), (1 : 2 : 1), (1 : 2 : 2), (2 : 0 : 1), (2 : 1 : 0), (2 : 1 : 1), (2 : 1 : 2), (2 : 2 : 1)}. -Let E(n) be the number of subsets of M(n) which can produce the mixture with ratio (1 : 1 : 1), i.e., the mixture with equal parts A, B and C. +Let E(n) be the number of subsets of M(n) which can produce the mixture with ratio (1 : 1 : 1), i.e., the mixture with equal parts A, B and C. We can verify that E(1) = 103, E(2) = 520447, E(10) mod 118 = 82608406 and E(500) mod 118 = 13801403. Find E(10 000 000) mod 118.
@@ -40,7 +40,7 @@ Find E(10 000 000) mod 118. ```yml tests: - text: euler478() should return 59510340. - testString: 'assert.strictEqual(euler478(), 59510340, ''euler478() should return 59510340.'');' + testString: 'assert.strictEqual(euler478(), 59510340, "euler478() should return 59510340.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-479-roots-on-the-rise.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-479-roots-on-the-rise.english.md index f1a4814c20..e529c84d26 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-479-roots-on-the-rise.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-479-roots-on-the-rise.english.md @@ -10,7 +10,7 @@ Let ak, bk, and ck represent the three solutions (real or complex numbers) to th For instance, for k = 5, we see that {a5, b5, c5} is approximately {5.727244, -0.363622+2.057397i, -0.363622-2.057397i}. -Let S(n) = Σ (ak+bk)p(bk+ck)p(ck+ak)p for all integers p, k such that 1 ≤ p, k ≤ n. +Let S(n) = Σ (ak+bk)p(bk+ck)p(ck+ak)p for all integers p, k such that 1 ≤ p, k ≤ n. Interestingly, S(n) is always an integer. For example, S(4) = 51160. @@ -28,7 +28,7 @@ Find S(106) modulo 1 000 000 007. ```yml tests: - text: euler479() should return 191541795. - testString: 'assert.strictEqual(euler479(), 191541795, ''euler479() should return 191541795.'');' + testString: 'assert.strictEqual(euler479(), 191541795, "euler479() should return 191541795.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-48-self-powers.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-48-self-powers.english.md index 2021ad0e61..73219de6d6 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-48-self-powers.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-48-self-powers.english.md @@ -21,13 +21,13 @@ Find the last ten digits of the series, 11 + 22 + 33< ```yml tests: - text: 'selfPowers(10, 3) should return 317.' - testString: 'assert.strictEqual(selfPowers(10, 3), 317, ''selfPowers(10, 3) should return 317.'');' + testString: 'assert.strictEqual(selfPowers(10, 3), 317, "selfPowers(10, 3) should return 317.");' - text: 'selfPowers(150, 6) should return 29045.' - testString: 'assert.strictEqual(selfPowers(150, 6), 29045, ''selfPowers(150, 6) should return 29045.'');' + testString: 'assert.strictEqual(selfPowers(150, 6), 29045, "selfPowers(150, 6) should return 29045.");' - text: 'selfPowers(673, 7) should return 2473989.' - testString: 'assert.strictEqual(selfPowers(673, 7), 2473989, ''selfPowers(673, 7) should return 2473989.'');' + testString: 'assert.strictEqual(selfPowers(673, 7), 2473989, "selfPowers(673, 7) should return 2473989.");' - text: 'selfPowers(1000, 10) should return 9110846700.' - testString: 'assert.strictEqual(selfPowers(1000, 10), 9110846700, ''selfPowers(1000, 10) should return 9110846700.'');' + testString: 'assert.strictEqual(selfPowers(1000, 10), 9110846700, "selfPowers(1000, 10) should return 9110846700.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-480-the-last-question.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-480-the-last-question.english.md index 106475e51c..f403127d5c 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-480-the-last-question.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-480-the-last-question.english.md @@ -58,7 +58,7 @@ Give your answer using lowercase characters (no punctuation or space). ```yml tests: - text: euler480() should return turnthestarson. - testString: 'assert.strictEqual(euler480(), turnthestarson, ''euler480() should return turnthestarson.'');' + testString: 'assert.strictEqual(euler480(), turnthestarson, "euler480() should return turnthestarson.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-49-prime-permutations.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-49-prime-permutations.english.md index e6686553b3..9f8a32ed6b 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-49-prime-permutations.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-49-prime-permutations.english.md @@ -22,7 +22,7 @@ What 12-digit number do you form by concatenating the three terms in this sequen ```yml tests: - text: primePermutations() should return 296962999629. - testString: 'assert.strictEqual(primePermutations(), 296962999629, ''primePermutations() should return 296962999629.'');' + testString: 'assert.strictEqual(primePermutations(), 296962999629, "primePermutations() should return 296962999629.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-5-smallest-multiple.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-5-smallest-multiple.english.md index e6900bdf7c..9b4472c767 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-5-smallest-multiple.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-5-smallest-multiple.english.md @@ -21,15 +21,15 @@ What is the smallest positive number that is evenly divisible by all of the numb ```yml tests: - text: smallestMult(5) should return 60. - testString: 'assert.strictEqual(smallestMult(5), 60, ''smallestMult(5) should return 60.'');' + testString: 'assert.strictEqual(smallestMult(5), 60, "smallestMult(5) should return 60.");' - text: smallestMult(7) should return 420. - testString: 'assert.strictEqual(smallestMult(7), 420, ''smallestMult(7) should return 420.'');' + testString: 'assert.strictEqual(smallestMult(7), 420, "smallestMult(7) should return 420.");' - text: smallestMult(10) should return 2520. - testString: 'assert.strictEqual(smallestMult(10), 2520, ''smallestMult(10) should return 2520.'');' + testString: 'assert.strictEqual(smallestMult(10), 2520, "smallestMult(10) should return 2520.");' - text: smallestMult(13) should return 360360. - testString: 'assert.strictEqual(smallestMult(13), 360360, ''smallestMult(13) should return 360360.'');' + testString: 'assert.strictEqual(smallestMult(13), 360360, "smallestMult(13) should return 360360.");' - text: smallestMult(20) should return 232792560. - testString: 'assert.strictEqual(smallestMult(20), 232792560, ''smallestMult(20) should return 232792560.'');' + testString: 'assert.strictEqual(smallestMult(20), 232792560, "smallestMult(20) should return 232792560.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-50-consecutive-prime-sum.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-50-consecutive-prime-sum.english.md index 080b967b31..3417f6cf3e 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-50-consecutive-prime-sum.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-50-consecutive-prime-sum.english.md @@ -24,9 +24,9 @@ Which prime, below one-million, can be written as the sum of the most consecutiv ```yml tests: - text: consecutivePrimeSum(1000) should return 953. - testString: 'assert.strictEqual(consecutivePrimeSum(1000), 953, ''consecutivePrimeSum(1000) should return 953.'');' + testString: 'assert.strictEqual(consecutivePrimeSum(1000), 953, "consecutivePrimeSum(1000) should return 953.");' - text: consecutivePrimeSum(1000000) should return 997651. - testString: 'assert.strictEqual(consecutivePrimeSum(1000000), 997651, ''consecutivePrimeSum(1000000) should return 997651.'');' + testString: 'assert.strictEqual(consecutivePrimeSum(1000000), 997651, "consecutivePrimeSum(1000000) should return 997651.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-51-prime-digit-replacements.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-51-prime-digit-replacements.english.md index 22435fd9f2..fc2336d3b3 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-51-prime-digit-replacements.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-51-prime-digit-replacements.english.md @@ -22,7 +22,7 @@ Find the smallest prime which, by replacing part of the number (not necessarily ```yml tests: - text: euler51() should return 121313. - testString: 'assert.strictEqual(euler51(), 121313, ''euler51() should return 121313.'');' + testString: 'assert.strictEqual(euler51(), 121313, "euler51() should return 121313.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-52-permuted-multiples.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-52-permuted-multiples.english.md index a4835f3e17..50450a32f9 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-52-permuted-multiples.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-52-permuted-multiples.english.md @@ -21,7 +21,7 @@ Find the smallest positive integer, x, such that 2x, 3x, 4x, 5x, and 6x, contain ```yml tests: - text: permutedMultiples() should return 142857. - testString: 'assert.strictEqual(permutedMultiples(), 142857, ''permutedMultiples() should return 142857.'');' + testString: 'assert.strictEqual(permutedMultiples(), 142857, "permutedMultiples() should return 142857.");' ``` @@ -53,11 +53,11 @@ permutedMultiples(); ```js function permutedMultiples() { - const isPermutation = (a, b) => - a.length !== b.length + const isPermutation = (a, b) => + a.length !== b.length ? false : a.split('').sort().join() === b.split('').sort().join(); - + let start = 1; let found = false; @@ -68,7 +68,7 @@ function permutedMultiples() { for (let i = start; i < start * 10 / 6; i++) { found = true; for (let j = 2; j <= 6; j++) { - if (!isPermutation(i + '', j * i + '')) { + if (!isPermutation(i + ", j * i + ")) { found = false; break; } diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-53-combinatoric-selections.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-53-combinatoric-selections.english.md index 5e9d57ff88..fb8f92ce33 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-53-combinatoric-selections.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-53-combinatoric-selections.english.md @@ -11,7 +11,7 @@ There are exactly ten ways of selecting three from five, 12345: In combinatorics, we use the notation, 5C3 = 10. In general, -nCr = +nCr = n!r!(n−r)! ,where r ≤ n, n! = n×(n−1)×...×3×2×1, and 0! = 1. @@ -30,13 +30,13 @@ How many, not necessarily distinct, values of  nCr, for 1 ≤ n ≤ 100, are gr ```yml tests: - text: combinatoricSelections(1000) should return 4626. - testString: 'assert.strictEqual(combinatoricSelections(1000), 4626, ''combinatoricSelections(1000) should return 4626.'');' + testString: 'assert.strictEqual(combinatoricSelections(1000), 4626, "combinatoricSelections(1000) should return 4626.");' - text: combinatoricSelections(10000) should return 4431. - testString: 'assert.strictEqual(combinatoricSelections(10000), 4431, ''combinatoricSelections(10000) should return 4431.'');' + testString: 'assert.strictEqual(combinatoricSelections(10000), 4431, "combinatoricSelections(10000) should return 4431.");' - text: combinatoricSelections(100000) should return 4255. - testString: 'assert.strictEqual(combinatoricSelections(100000), 4255, ''combinatoricSelections(100000) should return 4255.'');' + testString: 'assert.strictEqual(combinatoricSelections(100000), 4255, "combinatoricSelections(100000) should return 4255.");' - text: combinatoricSelections(1000000) should return 4075. - testString: 'assert.strictEqual(combinatoricSelections(1000000), 4075, ''combinatoricSelections(1000000) should return 4075.'');' + testString: 'assert.strictEqual(combinatoricSelections(1000000), 4075, "combinatoricSelections(1000000) should return 4075.");' ``` @@ -68,7 +68,7 @@ combinatoricSelections(1000000); ```js function combinatoricSelections(limit) { - const factorial = n => + const factorial = n => Array.apply(null, { length: n }) .map((_, i) => i + 1) .reduce((p, c) => p * c, 1); diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-54-poker-hands.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-54-poker-hands.english.md index bf48019596..5994b0ee1f 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-54-poker-hands.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-54-poker-hands.english.md @@ -43,7 +43,7 @@ How many hands does Player 1 win? ```yml tests: - text: euler54() should return 376. - testString: 'assert.strictEqual(euler54(), 376, ''euler54() should return 376.'');' + testString: 'assert.strictEqual(euler54(), 376, "euler54() should return 376.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-55-lychrel-numbers.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-55-lychrel-numbers.english.md index 344d564c66..9dceee5a79 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-55-lychrel-numbers.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-55-lychrel-numbers.english.md @@ -29,15 +29,15 @@ NOTE: Wording was modified slightly on 24 April 2007 to emphasise the theoretica ```yml tests: - text: countLychrelNumbers(1000) should return 13. - testString: 'assert.strictEqual(countLychrelNumbers(1000), 13, ''countLychrelNumbers(1000) should return 13.'');' + testString: 'assert.strictEqual(countLychrelNumbers(1000), 13, "countLychrelNumbers(1000) should return 13.");' - text: countLychrelNumbers(5000) should return 76. - testString: 'assert.strictEqual(countLychrelNumbers(5000), 76, ''countLychrelNumbers(5000) should return 76.'');' + testString: 'assert.strictEqual(countLychrelNumbers(5000), 76, "countLychrelNumbers(5000) should return 76.");' - text: countLychrelNumbers(10000) should return 249. - testString: 'assert.strictEqual(countLychrelNumbers(10000), 249, ''countLychrelNumbers(10000) should return 249.'');' + testString: 'assert.strictEqual(countLychrelNumbers(10000), 249, "countLychrelNumbers(10000) should return 249.");' - text: Your function should count all Lychrel numbers. - testString: 'assert.strictEqual(countLychrelNumbers(3243), 39, ''Your function should count all Lychrel numbers.'');' + testString: 'assert.strictEqual(countLychrelNumbers(3243), 39, "Your function should count all Lychrel numbers.");' - text: Your function should pass all test cases. - testString: 'assert.strictEqual(countLychrelNumbers(7654), 140, ''Your function should pass all test cases.'');' + testString: 'assert.strictEqual(countLychrelNumbers(7654), 140, "Your function should pass all test cases.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-56-powerful-digit-sum.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-56-powerful-digit-sum.english.md index babbee7faa..a2edb1be87 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-56-powerful-digit-sum.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-56-powerful-digit-sum.english.md @@ -21,7 +21,7 @@ Considering natural numbers of the form, ab, where a, b < 100, what is the maxim ```yml tests: - text: euler56() should return 972. - testString: 'assert.strictEqual(euler56(), 972, ''euler56() should return 972.'');' + testString: 'assert.strictEqual(euler56(), 972, "euler56() should return 972.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-57-square-root-convergents.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-57-square-root-convergents.english.md index b85c4e0311..5ddb0613ef 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-57-square-root-convergents.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-57-square-root-convergents.english.md @@ -28,7 +28,7 @@ In the first one-thousand expansions, how many fractions contain a numerator wit ```yml tests: - text: euler57() should return 153. - testString: 'assert.strictEqual(euler57(), 153, ''euler57() should return 153.'');' + testString: 'assert.strictEqual(euler57(), 153, "euler57() should return 153.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-58-spiral-primes.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-58-spiral-primes.english.md index b5fbd0383d..d6bce0772f 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-58-spiral-primes.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-58-spiral-primes.english.md @@ -28,7 +28,7 @@ If one complete new layer is wrapped around the spiral above, a square spiral wi ```yml tests: - text: euler58() should return 26241. - testString: 'assert.strictEqual(euler58(), 26241, ''euler58() should return 26241.'');' + testString: 'assert.strictEqual(euler58(), 26241, "euler58() should return 26241.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-59-xor-decryption.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-59-xor-decryption.english.md index adb4e848f6..e2e8cebd77 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-59-xor-decryption.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-59-xor-decryption.english.md @@ -24,7 +24,7 @@ Your task has been made easy, as the encryption key consists of three lower case ```yml tests: - text: euler59() should return 107359. - testString: 'assert.strictEqual(euler59(), 107359, ''euler59() should return 107359.'');' + testString: 'assert.strictEqual(euler59(), 107359, "euler59() should return 107359.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-6-sum-square-difference.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-6-sum-square-difference.english.md index e1a7cf2e35..1a6f25d7b8 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-6-sum-square-difference.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-6-sum-square-difference.english.md @@ -25,11 +25,11 @@ Find the difference between the sum of the squares of the first n n ```yml tests: - text: sumSquareDifference(10) should return 2640. - testString: 'assert.strictEqual(sumSquareDifference(10), 2640, ''sumSquareDifference(10) should return 2640.'');' + testString: 'assert.strictEqual(sumSquareDifference(10), 2640, "sumSquareDifference(10) should return 2640.");' - text: sumSquareDifference(20) should return 41230. - testString: 'assert.strictEqual(sumSquareDifference(20), 41230, ''sumSquareDifference(20) should return 41230.'');' + testString: 'assert.strictEqual(sumSquareDifference(20), 41230, "sumSquareDifference(20) should return 41230.");' - text: sumSquareDifference(100) should return 25164150. - testString: 'assert.strictEqual(sumSquareDifference(100), 25164150, ''sumSquareDifference(100) should return 25164150.'');' + testString: 'assert.strictEqual(sumSquareDifference(100), 25164150, "sumSquareDifference(100) should return 25164150.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-60-prime-pair-sets.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-60-prime-pair-sets.english.md index 6a93d8a77e..1a5235bc88 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-60-prime-pair-sets.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-60-prime-pair-sets.english.md @@ -21,7 +21,7 @@ Find the lowest sum for a set of five primes for which any two primes concatenat ```yml tests: - text: euler60() should return 26033. - testString: 'assert.strictEqual(euler60(), 26033, ''euler60() should return 26033.'');' + testString: 'assert.strictEqual(euler60(), 26033, "euler60() should return 26033.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-61-cyclical-figurate-numbers.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-61-cyclical-figurate-numbers.english.md index b6150f1459..b5a9237137 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-61-cyclical-figurate-numbers.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-61-cyclical-figurate-numbers.english.md @@ -55,7 +55,7 @@ Find the sum of the only ordered set of six cyclic 4-digit numbers for which eac ```yml tests: - text: euler61() should return 28684. - testString: 'assert.strictEqual(euler61(), 28684, ''euler61() should return 28684.'');' + testString: 'assert.strictEqual(euler61(), 28684, "euler61() should return 28684.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-62-cubic-permutations.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-62-cubic-permutations.english.md index 8b4cef5a1b..449d57a719 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-62-cubic-permutations.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-62-cubic-permutations.english.md @@ -21,7 +21,7 @@ Find the smallest cube for which exactly five permutations of its digits are cub ```yml tests: - text: euler62() should return 127035954683. - testString: 'assert.strictEqual(euler62(), 127035954683, ''euler62() should return 127035954683.'');' + testString: 'assert.strictEqual(euler62(), 127035954683, "euler62() should return 127035954683.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-63-powerful-digit-counts.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-63-powerful-digit-counts.english.md index 0bb3c1df26..5529a9bf30 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-63-powerful-digit-counts.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-63-powerful-digit-counts.english.md @@ -21,7 +21,7 @@ How many n-digit positive integers exist which are also an nth power? ```yml tests: - text: euler63() should return 49. - testString: 'assert.strictEqual(euler63(), 49, ''euler63() should return 49.'');' + testString: 'assert.strictEqual(euler63(), 49, "euler63() should return 49.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-64-odd-period-square-roots.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-64-odd-period-square-roots.english.md index cdc0a24cad..36d1ca7db1 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-64-odd-period-square-roots.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-64-odd-period-square-roots.english.md @@ -143,7 +143,7 @@ How many continued fractions for N ≤ 10000 have an odd period? ```yml tests: - text: euler64() should return 1322. - testString: 'assert.strictEqual(euler64(), 1322, ''euler64() should return 1322.'');' + testString: 'assert.strictEqual(euler64(), 1322, "euler64() should return 1322.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-65-convergents-of-e.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-65-convergents-of-e.english.md index 609dab0a72..42c9742b82 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-65-convergents-of-e.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-65-convergents-of-e.english.md @@ -109,7 +109,7 @@ Find the sum of digits in the numerator of the 100th convergent of the continued ```yml tests: - text: euler65() should return 272. - testString: 'assert.strictEqual(euler65(), 272, ''euler65() should return 272.'');' + testString: 'assert.strictEqual(euler65(), 272, "euler65() should return 272.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-66-diophantine-equation.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-66-diophantine-equation.english.md index 8810816566..8155e34f86 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-66-diophantine-equation.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-66-diophantine-equation.english.md @@ -30,7 +30,7 @@ Find the value of D ≤ 1000 in minimal solutions of x for which the largest val ```yml tests: - text: euler66() should return 661. - testString: 'assert.strictEqual(euler66(), 661, ''euler66() should return 661.'');' + testString: 'assert.strictEqual(euler66(), 661, "euler66() should return 661.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-67-maximum-path-sum-ii.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-67-maximum-path-sum-ii.english.md index a7f6409285..a7373f4b8f 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-67-maximum-path-sum-ii.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-67-maximum-path-sum-ii.english.md @@ -26,7 +26,7 @@ NOTE: This is a much more difficult version of Problem 18. It is not possible to ```yml tests: - text: euler67() should return 7273. - testString: 'assert.strictEqual(euler67(), 7273, ''euler67() should return 7273.'');' + testString: 'assert.strictEqual(euler67(), 7273, "euler67() should return 7273.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-68-magic-5-gon-ring.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-68-magic-5-gon-ring.english.md index a4d69bbc8a..716c008407 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-68-magic-5-gon-ring.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-68-magic-5-gon-ring.english.md @@ -37,7 +37,7 @@ Using the numbers 1 to 10, and depending on arrangements, it is possible to form ```yml tests: - text: euler68() should return 6531031914842725. - testString: 'assert.strictEqual(euler68(), 6531031914842725, ''euler68() should return 6531031914842725.'');' + testString: 'assert.strictEqual(euler68(), 6531031914842725, "euler68() should return 6531031914842725.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-69-totient-maximum.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-69-totient-maximum.english.md index 345cd1c971..9389fe54f5 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-69-totient-maximum.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-69-totient-maximum.english.md @@ -64,7 +64,7 @@ Find the value of n ≤ 1,000,000 for which n/φ(n) is a maximum. ```yml tests: - text: euler69() should return 510510. - testString: 'assert.strictEqual(euler69(), 510510, ''euler69() should return 510510.'');' + testString: 'assert.strictEqual(euler69(), 510510, "euler69() should return 510510.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-7-10001st-prime.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-7-10001st-prime.english.md index 4a434e3010..ab57c05253 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-7-10001st-prime.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-7-10001st-prime.english.md @@ -21,15 +21,15 @@ What is the nth prime number? ```yml tests: - text: nthPrime(6) should return 13. - testString: 'assert.strictEqual(nthPrime(6), 13, ''nthPrime(6) should return 13.'');' + testString: 'assert.strictEqual(nthPrime(6), 13, "nthPrime(6) should return 13.");' - text: nthPrime(10) should return 29. - testString: 'assert.strictEqual(nthPrime(10), 29, ''nthPrime(10) should return 29.'');' + testString: 'assert.strictEqual(nthPrime(10), 29, "nthPrime(10) should return 29.");' - text: nthPrime(100) should return 541. - testString: 'assert.strictEqual(nthPrime(100), 541, ''nthPrime(100) should return 541.'');' + testString: 'assert.strictEqual(nthPrime(100), 541, "nthPrime(100) should return 541.");' - text: nthPrime(1000) should return 7919. - testString: 'assert.strictEqual(nthPrime(1000), 7919, ''nthPrime(1000) should return 7919.'');' + testString: 'assert.strictEqual(nthPrime(1000), 7919, "nthPrime(1000) should return 7919.");' - text: nthPrime(10001) should return 104743. - testString: 'assert.strictEqual(nthPrime(10001), 104743, ''nthPrime(10001) should return 104743.'');' + testString: 'assert.strictEqual(nthPrime(10001), 104743, "nthPrime(10001) should return 104743.");' ``` @@ -71,7 +71,7 @@ const nthPrime = (number)=>{ break; } } - isPrime ? step++ : ''; + isPrime ? step++ : "; pN++; } return pN-1; diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-70-totient-permutation.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-70-totient-permutation.english.md index f76bf6f144..843bac9186 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-70-totient-permutation.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-70-totient-permutation.english.md @@ -6,7 +6,7 @@ title: 'Problem 70: Totient permutation' ## Description
-Euler's Totient function, φ(n) [sometimes called the phi function], is used to determine the number of positive numbers less than or equal to n which are relatively prime to n. For example, as 1, 2, 4, 5, 7, and 8, are all less than nine and relatively prime to nine, φ(9)=6.The number 1 is considered to be relatively prime to every positive number, so φ(1)=1. +Euler's Totient function, φ(n) [sometimes called the phi function], is used to determine the number of positive numbers less than or equal to n which are relatively prime to n. For example, as 1, 2, 4, 5, 7, and 8, are all less than nine and relatively prime to nine, φ(9)=6.The number 1 is considered to be relatively prime to every positive number, so φ(1)=1. Interestingly, φ(87109)=79180, and it can be seen that 87109 is a permutation of 79180. Find the value of n, 1 < n < 107, for which φ(n) is a permutation of n and the ratio n/φ(n) produces a minimum.
@@ -22,7 +22,7 @@ Find the value of n, 1 < n < 107, for which φ(n) is a permutation of n and the ```yml tests: - text: euler70() should return 8319823. - testString: 'assert.strictEqual(euler70(), 8319823, ''euler70() should return 8319823.'');' + testString: 'assert.strictEqual(euler70(), 8319823, "euler70() should return 8319823.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-71-ordered-fractions.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-71-ordered-fractions.english.md index 04b1da2b39..118b5ab44a 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-71-ordered-fractions.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-71-ordered-fractions.english.md @@ -24,7 +24,7 @@ By listing the set of reduced proper fractions for d ≤ 1,000,000 in ascending ```yml tests: - text: euler71() should return 428570. - testString: 'assert.strictEqual(euler71(), 428570, ''euler71() should return 428570.'');' + testString: 'assert.strictEqual(euler71(), 428570, "euler71() should return 428570.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-72-counting-fractions.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-72-counting-fractions.english.md index 6f8ba263d1..1dbb451e47 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-72-counting-fractions.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-72-counting-fractions.english.md @@ -24,7 +24,7 @@ How many elements would be contained in the set of reduced proper fractions for ```yml tests: - text: euler72() should return 303963552391. - testString: 'assert.strictEqual(euler72(), 303963552391, ''euler72() should return 303963552391.'');' + testString: 'assert.strictEqual(euler72(), 303963552391, "euler72() should return 303963552391.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-73-counting-fractions-in-a-range.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-73-counting-fractions-in-a-range.english.md index 3ecfc94f8f..fae5016d1f 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-73-counting-fractions-in-a-range.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-73-counting-fractions-in-a-range.english.md @@ -24,7 +24,7 @@ How many fractions lie between 1/3 and 1/2 in the sorted set of reduced proper f ```yml tests: - text: euler73() should return 7295372. - testString: 'assert.strictEqual(euler73(), 7295372, ''euler73() should return 7295372.'');' + testString: 'assert.strictEqual(euler73(), 7295372, "euler73() should return 7295372.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-74-digit-factorial-chains.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-74-digit-factorial-chains.english.md index 8027557a50..2b183f74dd 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-74-digit-factorial-chains.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-74-digit-factorial-chains.english.md @@ -31,7 +31,7 @@ How many chains, with a starting number below one million, contain exactly sixty ```yml tests: - text: euler74() should return 402. - testString: 'assert.strictEqual(euler74(), 402, ''euler74() should return 402.'');' + testString: 'assert.strictEqual(euler74(), 402, "euler74() should return 402.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-75-singular-integer-right-triangles.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-75-singular-integer-right-triangles.english.md index c6b0c3cf55..e7d56bd059 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-75-singular-integer-right-triangles.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-75-singular-integer-right-triangles.english.md @@ -24,7 +24,7 @@ Given that L is the length of the wire, for how many values of L ≤ 1,500,000 c ```yml tests: - text: euler75() should return 161667. - testString: 'assert.strictEqual(euler75(), 161667, ''euler75() should return 161667.'');' + testString: 'assert.strictEqual(euler75(), 161667, "euler75() should return 161667.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-76-counting-summations.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-76-counting-summations.english.md index 4c3f17bd9f..9be879e18f 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-76-counting-summations.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-76-counting-summations.english.md @@ -27,7 +27,7 @@ How many different ways can one hundred be written as a sum of at least two posi ```yml tests: - text: euler76() should return 190569291. - testString: 'assert.strictEqual(euler76(), 190569291, ''euler76() should return 190569291.'');' + testString: 'assert.strictEqual(euler76(), 190569291, "euler76() should return 190569291.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-77-prime-summations.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-77-prime-summations.english.md index a95f25b36d..374956ef13 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-77-prime-summations.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-77-prime-summations.english.md @@ -26,7 +26,7 @@ What is the first value which can be written as the sum of primes in over five t ```yml tests: - text: euler77() should return 71. - testString: 'assert.strictEqual(euler77(), 71, ''euler77() should return 71.'');' + testString: 'assert.strictEqual(euler77(), 71, "euler77() should return 71.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-78-coin-partitions.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-78-coin-partitions.english.md index ae5557859c..a219285dd4 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-78-coin-partitions.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-78-coin-partitions.english.md @@ -30,7 +30,7 @@ Find the least value of n for which p(n) is divisible by one million. ```yml tests: - text: euler78() should return 55374. - testString: 'assert.strictEqual(euler78(), 55374, ''euler78() should return 55374.'');' + testString: 'assert.strictEqual(euler78(), 55374, "euler78() should return 55374.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-79-passcode-derivation.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-79-passcode-derivation.english.md index 9e06ef7eba..31d0ab45d0 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-79-passcode-derivation.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-79-passcode-derivation.english.md @@ -22,7 +22,7 @@ Given that the three characters are always asked for in order, analyse the file ```yml tests: - text: euler79() should return 73162890. - testString: 'assert.strictEqual(euler79(), 73162890, ''euler79() should return 73162890.'');' + testString: 'assert.strictEqual(euler79(), 73162890, "euler79() should return 73162890.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-8-largest-product-in-a-series.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-8-largest-product-in-a-series.english.md index 7e0ca5af36..60391ed1c7 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-8-largest-product-in-a-series.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-8-largest-product-in-a-series.english.md @@ -42,9 +42,9 @@ Find the n adjacent digits in the 1000-digit number that have the g ```yml tests: - text: largestProductinaSeries(4) should return 5832. - testString: 'assert.strictEqual(largestProductinaSeries(4), 5832, ''largestProductinaSeries(4) should return 5832.'');' + testString: 'assert.strictEqual(largestProductinaSeries(4), 5832, "largestProductinaSeries(4) should return 5832.");' - text: largestProductinaSeries(13) should return 23514624000. - testString: 'assert.strictEqual(largestProductinaSeries(13), 23514624000, ''largestProductinaSeries(13) should return 23514624000.'');' + testString: 'assert.strictEqual(largestProductinaSeries(13), 23514624000, "largestProductinaSeries(13) should return 23514624000.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-80-square-root-digital-expansion.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-80-square-root-digital-expansion.english.md index d83edf0eda..5da6dd6731 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-80-square-root-digital-expansion.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-80-square-root-digital-expansion.english.md @@ -22,7 +22,7 @@ For the first one hundred natural numbers, find the total of the digital sums of ```yml tests: - text: euler80() should return 40886. - testString: 'assert.strictEqual(euler80(), 40886, ''euler80() should return 40886.'');' + testString: 'assert.strictEqual(euler80(), 40886, "euler80() should return 40886.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-81-path-sum-two-ways.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-81-path-sum-two-ways.english.md index d13c724067..00506d957b 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-81-path-sum-two-ways.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-81-path-sum-two-ways.english.md @@ -32,7 +32,7 @@ Find the minimal path sum, in matrix.txt (right click and "Save Link/Target As.. ```yml tests: - text: euler81() should return 427337. - testString: 'assert.strictEqual(euler81(), 427337, ''euler81() should return 427337.'');' + testString: 'assert.strictEqual(euler81(), 427337, "euler81() should return 427337.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-82-path-sum-three-ways.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-82-path-sum-three-ways.english.md index a5e7aa3b4d..d8b018f979 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-82-path-sum-three-ways.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-82-path-sum-three-ways.english.md @@ -33,7 +33,7 @@ Find the minimal path sum, in matrix.txt (right click and "Save Link/Target As.. ```yml tests: - text: euler82() should return 260324. - testString: 'assert.strictEqual(euler82(), 260324, ''euler82() should return 260324.'');' + testString: 'assert.strictEqual(euler82(), 260324, "euler82() should return 260324.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-83-path-sum-four-ways.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-83-path-sum-four-ways.english.md index 894dd13340..8e7fab8a5a 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-83-path-sum-four-ways.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-83-path-sum-four-ways.english.md @@ -19,7 +19,7 @@ $$ \end{pmatrix} $$ -Find the minimal path sum, in matrix.txt (right click and +Find the minimal path sum, in matrix.txt (right click and "Save Link/Target As..."), a 31K text file containing a 80 by 80 matrix, from the top left to the bottom right by moving left, right, up, and down.
@@ -34,7 +34,7 @@ Find the minimal path sum, in matrix.txt (right click and ```yml tests: - text: euler83() should return 425185. - testString: 'assert.strictEqual(euler83(), 425185, ''euler83() should return 425185.'');' + testString: 'assert.strictEqual(euler83(), 425185, "euler83() should return 425185.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-84-monopoly-odds.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-84-monopoly-odds.english.md index 8573e459e4..fe95722ee9 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-84-monopoly-odds.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-84-monopoly-odds.english.md @@ -94,7 +94,7 @@ If, instead of using two 6-sided dice, two 4-sided dice are used, find the six-d ```yml tests: - text: euler84() should return 101524. - testString: 'assert.strictEqual(euler84(), 101524, ''euler84() should return 101524.'');' + testString: 'assert.strictEqual(euler84(), 101524, "euler84() should return 101524.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-85-counting-rectangles.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-85-counting-rectangles.english.md index a17058486e..ab8981fd73 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-85-counting-rectangles.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-85-counting-rectangles.english.md @@ -23,7 +23,7 @@ Although there exists no rectangular grid that contains exactly two million rect ```yml tests: - text: euler85() should return 2772. - testString: 'assert.strictEqual(euler85(), 2772, ''euler85() should return 2772.'');' + testString: 'assert.strictEqual(euler85(), 2772, "euler85() should return 2772.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-86-cuboid-route.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-86-cuboid-route.english.md index ed62c45fda..6ec180c3e4 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-86-cuboid-route.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-86-cuboid-route.english.md @@ -25,7 +25,7 @@ Find the least value of M such that the number of solutions first exceeds one mi ```yml tests: - text: euler86() should return 1818. - testString: 'assert.strictEqual(euler86(), 1818, ''euler86() should return 1818.'');' + testString: 'assert.strictEqual(euler86(), 1818, "euler86() should return 1818.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-87-prime-power-triples.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-87-prime-power-triples.english.md index d6e0fdd212..fe07f9a418 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-87-prime-power-triples.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-87-prime-power-triples.english.md @@ -25,7 +25,7 @@ How many numbers below fifty million can be expressed as the sum of a prime squa ```yml tests: - text: euler87() should return 1097343. - testString: 'assert.strictEqual(euler87(), 1097343, ''euler87() should return 1097343.'');' + testString: 'assert.strictEqual(euler87(), 1097343, "euler87() should return 1097343.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-88-product-sum-numbers.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-88-product-sum-numbers.english.md index d4d8e079ce..9b12e8ccf1 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-88-product-sum-numbers.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-88-product-sum-numbers.english.md @@ -26,7 +26,7 @@ What is the sum of all the minimal product-sum numbers for 2≤k≤12000? ```yml tests: - text: euler88() should return 7587457. - testString: 'assert.strictEqual(euler88(), 7587457, ''euler88() should return 7587457.'');' + testString: 'assert.strictEqual(euler88(), 7587457, "euler88() should return 7587457.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-89-roman-numerals.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-89-roman-numerals.english.md index f49d91bbca..7cdddb3b5f 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-89-roman-numerals.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-89-roman-numerals.english.md @@ -31,7 +31,7 @@ Note: You can assume that all the Roman numerals in the file contain no more tha ```yml tests: - text: euler89() should return 743. - testString: 'assert.strictEqual(euler89(), 743, ''euler89() should return 743.'');' + testString: 'assert.strictEqual(euler89(), 743, "euler89() should return 743.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-9-special-pythagorean-triplet.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-9-special-pythagorean-triplet.english.md index 022e4c2fb4..736634d42a 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-9-special-pythagorean-triplet.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-9-special-pythagorean-triplet.english.md @@ -23,11 +23,11 @@ There exists exactly one Pythagorean triplet for which a + bspecialPythagoreanTriplet(1000) should return 31875000. - testString: 'assert.strictEqual(specialPythagoreanTriplet(1000), 31875000, ''specialPythagoreanTriplet(1000) should return 31875000.'');' + testString: 'assert.strictEqual(specialPythagoreanTriplet(1000), 31875000, "specialPythagoreanTriplet(1000) should return 31875000.");' - text: specialPythagoreanTriplet(24) should return 480. - testString: 'assert.strictEqual(specialPythagoreanTriplet(24), 480, ''specialPythagoreanTriplet(24) should return 480.'');' + testString: 'assert.strictEqual(specialPythagoreanTriplet(24), 480, "specialPythagoreanTriplet(24) should return 480.");' - text: specialPythagoreanTriplet(120) should return 49920. - testString: 'assert.strictEqual(specialPythagoreanTriplet(120), 49920, ''specialPythagoreanTriplet(120) should return 49920.'');' + testString: 'assert.strictEqual(specialPythagoreanTriplet(120), 49920, "specialPythagoreanTriplet(120) should return 49920.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-90-cube-digit-pairs.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-90-cube-digit-pairs.english.md index d499a8b72b..72673b7ef6 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-90-cube-digit-pairs.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-90-cube-digit-pairs.english.md @@ -40,7 +40,7 @@ How many distinct arrangements of the two cubes allow for all of the square numb ```yml tests: - text: euler90() should return 1217. - testString: 'assert.strictEqual(euler90(), 1217, ''euler90() should return 1217.'');' + testString: 'assert.strictEqual(euler90(), 1217, "euler90() should return 1217.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-91-right-triangles-with-integer-coordinates.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-91-right-triangles-with-integer-coordinates.english.md index b081144698..5d90752c04 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-91-right-triangles-with-integer-coordinates.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-91-right-triangles-with-integer-coordinates.english.md @@ -30,7 +30,7 @@ Given that 0 ≤ x1, y1, x2, y2 ≤ 50, how many right triangles can be formed? ```yml tests: - text: euler91() should return 14234. - testString: 'assert.strictEqual(euler91(), 14234, ''euler91() should return 14234.'');' + testString: 'assert.strictEqual(euler91(), 14234, "euler91() should return 14234.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-92-square-digit-chains.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-92-square-digit-chains.english.md index 305436a3cc..498821f67a 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-92-square-digit-chains.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-92-square-digit-chains.english.md @@ -25,7 +25,7 @@ How many starting numbers below ten million will arrive at 89? ```yml tests: - text: euler92() should return 8581146. - testString: 'assert.strictEqual(euler92(), 8581146, ''euler92() should return 8581146.'');' + testString: 'assert.strictEqual(euler92(), 8581146, "euler92() should return 8581146.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-93-arithmetic-expressions.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-93-arithmetic-expressions.english.md index 33d868c691..2f4b5b944e 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-93-arithmetic-expressions.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-93-arithmetic-expressions.english.md @@ -28,7 +28,7 @@ Find the set of four distinct digits, a < b < c < d, for which the longest set o ```yml tests: - text: euler93() should return 1258. - testString: 'assert.strictEqual(euler93(), 1258, ''euler93() should return 1258.'');' + testString: 'assert.strictEqual(euler93(), 1258, "euler93() should return 1258.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-94-almost-equilateral-triangles.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-94-almost-equilateral-triangles.english.md index b749405038..ea2317f8da 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-94-almost-equilateral-triangles.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-94-almost-equilateral-triangles.english.md @@ -22,7 +22,7 @@ Find the sum of the perimeters of all almost equilateral triangles with integral ```yml tests: - text: euler94() should return 518408346. - testString: 'assert.strictEqual(euler94(), 518408346, ''euler94() should return 518408346.'');' + testString: 'assert.strictEqual(euler94(), 518408346, "euler94() should return 518408346.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-95-amicable-chains.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-95-amicable-chains.english.md index bf7a577a86..1989efac8b 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-95-amicable-chains.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-95-amicable-chains.english.md @@ -25,7 +25,7 @@ Find the smallest member of the longest amicable chain with no element exceeding ```yml tests: - text: euler95() should return 14316. - testString: 'assert.strictEqual(euler95(), 14316, ''euler95() should return 14316.'');' + testString: 'assert.strictEqual(euler95(), 14316, "euler95() should return 14316.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-96-su-doku.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-96-su-doku.english.md index da82f05106..543ff5745b 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-96-su-doku.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-96-su-doku.english.md @@ -48,7 +48,7 @@ By solving all fifty puzzles find the sum of the 3-digit numbers found in the to ```yml tests: - text: euler96() should return 24702. - testString: 'assert.strictEqual(euler96(), 24702, ''euler96() should return 24702.'');' + testString: 'assert.strictEqual(euler96(), 24702, "euler96() should return 24702.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-97-large-non-mersenne-prime.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-97-large-non-mersenne-prime.english.md index e2cd8f07f2..20ec08eeaf 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-97-large-non-mersenne-prime.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-97-large-non-mersenne-prime.english.md @@ -22,7 +22,7 @@ Find the last ten digits of this prime number. ```yml tests: - text: euler97() should return 8739992577. - testString: 'assert.strictEqual(euler97(), 8739992577, ''euler97() should return 8739992577.'');' + testString: 'assert.strictEqual(euler97(), 8739992577, "euler97() should return 8739992577.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-98-anagramic-squares.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-98-anagramic-squares.english.md index b1a79e8051..fc6de999c4 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-98-anagramic-squares.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-98-anagramic-squares.english.md @@ -23,7 +23,7 @@ NOTE: All anagrams formed must be contained in the given text file. ```yml tests: - text: euler98() should return 18769. - testString: 'assert.strictEqual(euler98(), 18769, ''euler98() should return 18769.'');' + testString: 'assert.strictEqual(euler98(), 18769, "euler98() should return 18769.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-99-largest-exponential.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-99-largest-exponential.english.md index 0978160054..181e86a28f 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-99-largest-exponential.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-99-largest-exponential.english.md @@ -23,7 +23,7 @@ NOTE: The first two lines in the file represent the numbers in the example given ```yml tests: - text: euler99() should return 709. - testString: 'assert.strictEqual(euler99(), 709, ''euler99() should return 709.'');' + testString: 'assert.strictEqual(euler99(), 709, "euler99() should return 709.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/100-doors.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/100-doors.english.md index 9a08d8de91..18f145c190 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/100-doors.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/100-doors.english.md @@ -21,11 +21,11 @@ challengeType: 5 ```yml tests: - text: getFinalOpenedDoors is a function. - testString: 'assert(typeof getFinalOpenedDoors === ''function'', ''getFinalOpenedDoors is a function.'');' + testString: 'assert(typeof getFinalOpenedDoors === "function", "getFinalOpenedDoors is a function.");' - text: getFinalOpenedDoors should return an array. - testString: 'assert(Array.isArray(getFinalOpenedDoors(100)), ''getFinalOpenedDoors should return an array.'');' + testString: 'assert(Array.isArray(getFinalOpenedDoors(100)), "getFinalOpenedDoors should return an array.");' - text: getFinalOpenedDoors did not produce the correct results. - testString: 'assert.deepEqual(getFinalOpenedDoors(100), solution, ''getFinalOpenedDoors did not produce the correct results.'');' + testString: 'assert.deepEqual(getFinalOpenedDoors(100), solution, "getFinalOpenedDoors did not produce the correct results.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/24-game.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/24-game.english.md index cedc214d6a..21e113077a 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/24-game.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/24-game.english.md @@ -35,15 +35,15 @@ challengeType: 5 ```yml tests: - text: solve24 is a function. - testString: 'assert(typeof solve24 === ''function'', ''solve24 is a function.'');' + testString: 'assert(typeof solve24 === "function", "solve24 is a function.");' - text: solve24("4878") should return (7-8/8)*4 or 4*(7-8/8) - testString: 'assert(include(answers[0], solve24(testCases[0])), ''solve24("4878") should return (7-8/8)*4 or 4*(7-8/8)'');' + testString: 'assert(include(answers[0], solve24(testCases[0])), "solve24("4878") should return (7-8/8)*4 or 4*(7-8/8)");' - text: solve24("1234") should return any arrangement of 1*2*3*4 - testString: 'assert(include(answers[1], solve24(testCases[1])), ''solve24("1234") should return any arrangement of 1*2*3*4'');' + testString: 'assert(include(answers[1], solve24(testCases[1])), "solve24("1234") should return any arrangement of 1*2*3*4");' - text: solve24("6789") should return (6*8)/(9-7) or (8*6)/(9-7) - testString: 'assert(include(answers[2], solve24(testCases[2])), ''solve24("6789") should return (6*8)/(9-7) or (8*6)/(9-7)'');' + testString: 'assert(include(answers[2], solve24(testCases[2])), "solve24("6789") should return (6*8)/(9-7) or (8*6)/(9-7)");' - text: solve24("1127") should return a permutation of (1+7)*(1*2) - testString: 'assert(include(answers[3], solve24(testCases[3])), ''solve24("1127") should return a permutation of (1+7)*(1*2)'');' + testString: 'assert(include(answers[3], solve24(testCases[3])), "solve24("1127") should return a permutation of (1+7)*(1*2)");' ``` 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 56d238dfcd..adec0ae9df 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 @@ -40,19 +40,19 @@ Task ```yml tests: - text: numberOfNames is a function. - testString: 'assert(typeof numberOfNames === ''function'', ''numberOfNames is a function.'');' + testString: 'assert(typeof numberOfNames === "function", "numberOfNames is a function.");' - text: numberOfNames(5) should equal 7. - testString: 'assert.equal(numberOfNames(5), 7, ''numberOfNames(5) should equal 7.'');' + testString: 'assert.equal(numberOfNames(5), 7, "numberOfNames(5) should equal 7.");' - text: numberOfNames(12) should equal 77. - testString: 'assert.equal(numberOfNames(12), 77, ''numberOfNames(12) should equal 77.'');' + testString: 'assert.equal(numberOfNames(12), 77, "numberOfNames(12) should equal 77.");' - text: numberOfNames(18) should equal 385. - testString: 'assert.equal(numberOfNames(18), 385, ''numberOfNames(18) should equal 385.'');' + testString: 'assert.equal(numberOfNames(18), 385, "numberOfNames(18) should equal 385.");' - text: numberOfNames(23) should equal 1255. - testString: 'assert.equal(numberOfNames(23), 1255, ''numberOfNames(23) should equal 1255.'');' + testString: 'assert.equal(numberOfNames(23), 1255, "numberOfNames(23) should equal 1255.");' - text: numberOfNames(42) should equal 53174. - testString: 'assert.equal(numberOfNames(42), 53174, ''numberOfNames(42) should equal 53174.'');' + testString: 'assert.equal(numberOfNames(42), 53174, "numberOfNames(42) should equal 53174.");' - text: numberOfNames(123) should equal 2552338241. - testString: 'assert.equal(numberOfNames(123), 2552338241, ''numberOfNames(123) should equal 2552338241.'');' + testString: 'assert.equal(numberOfNames(123), 2552338241, "numberOfNames(123) should equal 2552338241.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/abc-problem.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/abc-problem.english.md index aadaa68024..897b2a90e1 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/abc-problem.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/abc-problem.english.md @@ -44,21 +44,21 @@ The function should be case-insensitive. ```yml tests: - text: canMakeWord is a function. - testString: 'assert(typeof canMakeWord === ''function'', ''canMakeWord is a function.'');' + testString: 'assert(typeof canMakeWord === "function", "canMakeWord is a function.");' - text: canMakeWord should return a boolean. - testString: 'assert(typeof canMakeWord(''hi'') === ''boolean'', ''canMakeWord should return a boolean.'');' + testString: 'assert(typeof canMakeWord("hi") === "boolean", "canMakeWord should return a boolean.");' - text: canMakeWord("bark") should return true. - testString: 'assert(canMakeWord(words[0]), ''canMakeWord("bark") should return true.'');' + testString: 'assert(canMakeWord(words[0]), "canMakeWord("bark") should return true.");' - text: canMakeWord("BooK") should return false. - testString: 'assert(!canMakeWord(words[1]), ''canMakeWord("BooK") should return false.'');' + testString: 'assert(!canMakeWord(words[1]), "canMakeWord("BooK") should return false.");' - text: canMakeWord("TReAT") should return true. - testString: 'assert(canMakeWord(words[2]), ''canMakeWord("TReAT") should return true.'');' + testString: 'assert(canMakeWord(words[2]), "canMakeWord("TReAT") should return true.");' - text: canMakeWord("COMMON") should return false. - testString: 'assert(!canMakeWord(words[3]), ''canMakeWord("COMMON") should return false.'');' + testString: 'assert(!canMakeWord(words[3]), "canMakeWord("COMMON") should return false.");' - text: canMakeWord("squAD") should return true. - testString: 'assert(canMakeWord(words[4]), ''canMakeWord("squAD") should return true.'');' + testString: 'assert(canMakeWord(words[4]), "canMakeWord("squAD") should return true.");' - text: canMakeWord("conFUSE") should return true. - testString: 'assert(canMakeWord(words[5]), ''canMakeWord("conFUSE") should return true.'');' + testString: 'assert(canMakeWord(words[5]), "canMakeWord("conFUSE") should return true.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/abundant-deficient-and-perfect-number-classifications.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/abundant-deficient-and-perfect-number-classifications.english.md index 4e8a8ded6b..0728ec8362 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/abundant-deficient-and-perfect-number-classifications.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/abundant-deficient-and-perfect-number-classifications.english.md @@ -28,13 +28,13 @@ challengeType: 5 ```yml tests: - text: getDPA is a function. - testString: 'assert(typeof getDPA === ''function'', ''getDPA is a function.'');' + testString: 'assert(typeof getDPA === "function", "getDPA is a function.");' - text: getDPA should return an array. - testString: 'assert(Array.isArray(getDPA(100)), ''getDPA should return an array.'');' + testString: 'assert(Array.isArray(getDPA(100)), "getDPA should return an array.");' - text: getDPA return value should have a length of 3. - testString: 'assert(getDPA(100).length === 3, ''getDPA return value should have a length of 3.'');' + testString: 'assert(getDPA(100).length === 3, "getDPA return value should have a length of 3.");' - text: 'getDPA(20000) should equal [15043, 4, 4953]' - testString: 'assert.deepEqual(getDPA(20000), solution, ''getDPA(20000) should equal [15043, 4, 4953]'');' + testString: 'assert.deepEqual(getDPA(20000), solution, "getDPA(20000) should equal [15043, 4, 4953]");' ``` 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 7b332e2ee7..3ac08927d1 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 @@ -24,13 +24,13 @@ challengeType: 5 ```yml tests: - text: accumulator is a function. - testString: 'assert(typeof accumulator === ''function'', ''accumulator is a function.'');' + testString: 'assert(typeof accumulator === "function", "accumulator is a function.");' - text: accumulator(0) should return a function. - testString: 'assert(typeof accumulator(0) === ''function'', ''accumulator(0) should return a function.'');' + testString: 'assert(typeof accumulator(0) === "function", "accumulator(0) should return a function.");' - text: accumulator(0)(2) should return a number. - testString: 'assert(typeof accumulator(0)(2) === ''number'', ''accumulator(0)(2) should return a number.'');' + testString: 'assert(typeof accumulator(0)(2) === "number", "accumulator(0)(2) should return a number.");' - text: 'Passing in the values 3, -4, 1.5, and 5 should return 5.5.' - testString: 'assert(testFn(5) === 5.5, ''Passing in the values 3, -4, 1.5, and 5 should return 5.5.'');' + testString: 'assert(testFn(5) === 5.5, "Passing in the values 3, -4, 1.5, and 5 should return 5.5.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/ackermann-function.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/ackermann-function.english.md index f0974f07e9..22827322d9 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/ackermann-function.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/ackermann-function.english.md @@ -28,15 +28,15 @@ $$A(m, n) = ```yml tests: - text: ack is a function. - testString: 'assert(typeof ack === ''function'', ''ack is a function.'');' + testString: 'assert(typeof ack === "function", "ack is a function.");' - text: 'ack(0, 0) should return 1.' - testString: 'assert(ack(0, 0) === 1, ''ack(0, 0) should return 1.'');' + testString: 'assert(ack(0, 0) === 1, "ack(0, 0) should return 1.");' - text: 'ack(1, 1) should return 3.' - testString: 'assert(ack(1, 1) === 3, ''ack(1, 1) should return 3.'');' + testString: 'assert(ack(1, 1) === 3, "ack(1, 1) should return 3.");' - text: 'ack(2, 5) should return 13.' - testString: 'assert(ack(2, 5) === 13, ''ack(2, 5) should return 13.'');' + testString: 'assert(ack(2, 5) === 13, "ack(2, 5) should return 13.");' - text: 'ack(3, 3) should return 61.' - testString: 'assert(ack(3, 3) === 61, ''ack(3, 3) should return 61.'');' + testString: 'assert(ack(3, 3) === 61, "ack(3, 3) should return 61.");' ``` 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 7435f231ce..7aaefb5af8 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 @@ -40,13 +40,13 @@ It is not a requirement to add separating characters between or around columns. ```yml tests: - text: formatText is a function. - testString: 'assert(typeof formatText === ''function'', ''formatText is a function.'');' + testString: 'assert(typeof formatText === "function", "formatText is a function.");' - text: 'formatText with the above input and "right" justification should produce the following: ' - testString: 'assert.strictEqual(formatText(testInput, ''right''), rightAligned, ''formatText with the above input and "right" justification should produce the following: '');' + testString: 'assert.strictEqual(formatText(testInput, "right"), rightAligned, "formatText with the above input and "right" justification should produce the following: ");' - text: 'formatText with the above input and "left" justification should produce the following: ' - testString: 'assert.strictEqual(formatText(testInput, ''left''), leftAligned, ''formatText with the above input and "left" justification should produce the following: '');' + testString: 'assert.strictEqual(formatText(testInput, "left"), leftAligned, "formatText with the above input and "left" justification should produce the following: ");' - text: 'formatText with the above input and "center" justification should produce the following: ' - testString: 'assert.strictEqual(formatText(testInput, ''center''), centerAligned, ''formatText with the above input and "center" justification should produce the following: '');' + testString: 'assert.strictEqual(formatText(testInput, "center"), centerAligned, "formatText with the above input and "center" justification should produce the following: ");' ``` @@ -131,10 +131,10 @@ function formatText (input, justification) { left = ' '.repeat(Math.floor(diff)); right = ' '.repeat(Math.ceil(diff)); if (justification === 'left') { - right += left; left = ''; + right += left; left = "; } if (justification === 'right') { - left += right; right = ''; + left += right; right = "; } input[y][x] = left + input[y][x] + right; } 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 254203c0e9..9311c99241 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 @@ -9,7 +9,7 @@ challengeType: 5 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: - 1, 2, 4, 8, 16, 32, 37, 74, 148, 296, 592 and + 1, 2, 4, 8, 16, 32, 37, 74, 148, 296, 592 and 1, 2, 5, 10, 11, 22, 55, 110, 121, 242, 605 respectively. Task: Calculate and show here the Amicable pairs below 20,000 (there are eight). @@ -30,13 +30,13 @@ Related tasks ```yml tests: - text: amicablePairsUpTo is a function. - testString: 'assert(typeof amicablePairsUpTo === ''function'', ''amicablePairsUpTo is a function.'');' + testString: 'assert(typeof amicablePairsUpTo === "function", "amicablePairsUpTo is a function.");' - text: 'amicablePairsUpTo(300) should return [[220,284]].' - testString: 'assert.deepEqual(amicablePairsUpTo(300), answer300, ''amicablePairsUpTo(300) should return [[220,284]].'');' + testString: 'assert.deepEqual(amicablePairsUpTo(300), answer300, "amicablePairsUpTo(300) should return [[220,284]].");' - text: 'amicablePairsUpTo(3000) should return [[220,284],[1184,1210],[2620,2924]].' - testString: 'assert.deepEqual(amicablePairsUpTo(3000), answer3000, ''amicablePairsUpTo(3000) should return [[220,284],[1184,1210],[2620,2924]].'');' + testString: 'assert.deepEqual(amicablePairsUpTo(3000), answer3000, "amicablePairsUpTo(3000) should return [[220,284],[1184,1210],[2620,2924]].");' - text: 'amicablePairsUpTo(20000) should return [[220,284],[1184,1210],[2620,2924],[5020,5564],[6232,6368],[10744,10856],[12285,14595],[17296,18416]].' - testString: 'assert.deepEqual(amicablePairsUpTo(20000), answer20000, ''amicablePairsUpTo(20000) should return [[220,284],[1184,1210],[2620,2924],[5020,5564],[6232,6368],[10744,10856],[12285,14595],[17296,18416]].'');' + testString: 'assert.deepEqual(amicablePairsUpTo(20000), answer20000, "amicablePairsUpTo(20000) should return [[220,284],[1184,1210],[2620,2924],[5020,5564],[6232,6368],[10744,10856],[12285,14595],[17296,18416]].");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/averages-mode.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/averages-mode.english.md index e9e1b1c60d..0788658223 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/averages-mode.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/averages-mode.english.md @@ -20,11 +20,11 @@ challengeType: 5 ```yml tests: - text: mode is a function. - testString: 'assert(typeof mode === ''function'', ''mode is a function.'');' + testString: 'assert(typeof mode === "function", "mode is a function.");' - text: 'mode([1, 3, 6, 6, 6, 6, 7, 7, 12, 12, 17]) should equal [6]' - testString: 'assert.deepEqual(mode(arr1), [6], ''mode([1, 3, 6, 6, 6, 6, 7, 7, 12, 12, 17]) should equal [6]'');' + testString: 'assert.deepEqual(mode(arr1), [6], "mode([1, 3, 6, 6, 6, 6, 7, 7, 12, 12, 17]) should equal [6]");' - text: 'mode([1, 2, 4, 4, 1]) should equal [1, 4].' - testString: 'assert.deepEqual(mode(arr2).sort(), [1, 4], ''mode([1, 2, 4, 4, 1]) should equal [1, 4].'');' + testString: 'assert.deepEqual(mode(arr2).sort(), [1, 4], "mode([1, 2, 4, 4, 1]) should equal [1, 4].");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/averages-pythagorean-means.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/averages-pythagorean-means.english.md index 8b23da7d19..69f551c9cc 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/averages-pythagorean-means.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/averages-pythagorean-means.english.md @@ -32,9 +32,9 @@ challengeType: 5 ```yml tests: - text: pythagoreanMeans is a function. - testString: 'assert(typeof pythagoreanMeans === ''function'', ''pythagoreanMeans is a function.'');' + testString: 'assert(typeof pythagoreanMeans === "function", "pythagoreanMeans is a function.");' - text: 'pythagoreanMeans([1, 2, ..., 10]) should equal the same output above.' - testString: 'assert.deepEqual(pythagoreanMeans(range1), answer1, ''pythagoreanMeans([1, 2, ..., 10]) should equal the same output above.'');' + testString: 'assert.deepEqual(pythagoreanMeans(range1), answer1, "pythagoreanMeans([1, 2, ..., 10]) should equal the same output above.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/averages-root-mean-square.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/averages-root-mean-square.english.md index 3ced892557..e3cc9c2df0 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/averages-root-mean-square.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/averages-root-mean-square.english.md @@ -22,9 +22,9 @@ challengeType: 5 ```yml tests: - text: rms is a function. - testString: 'assert(typeof rms === ''function'', ''rms is a function.'');' + testString: 'assert(typeof rms === "function", "rms is a function.");' - text: 'rms([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) should equal 6.2048368229954285.' - testString: 'assert.equal(rms(arr1), answer1, ''rms([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) should equal 6.2048368229954285.'');' + testString: 'assert.equal(rms(arr1), answer1, "rms([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) should equal 6.2048368229954285.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/babbage-problem.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/babbage-problem.english.md index 692ccd7f29..2b872d366e 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/babbage-problem.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/babbage-problem.english.md @@ -25,9 +25,9 @@ challengeType: 5 ```yml tests: - text: babbage is a function. - testString: 'assert(typeof babbage === ''function'', ''babbage is a function.'');' + testString: 'assert(typeof babbage === "function", "babbage is a function.");' - text: 'babbage(99736, 269696) should not return 99736 (there is a smaller answer).' - testString: 'assert.equal(babbage(babbageAns, endDigits), answer, ''babbage(99736, 269696) should not return 99736 (there is a smaller answer).'');' + testString: 'assert.equal(babbage(babbageAns, endDigits), answer, "babbage(99736, 269696) should not return 99736 (there is a smaller answer).");' ``` @@ -66,7 +66,7 @@ console.info('after the test'); ```js function babbage (babbageAns, endDigits) { const babbageNum = Math.pow(babbageAns, 2); - const babbageStartDigits = parseInt(babbageNum.toString().replace('269696', '')); + const babbageStartDigits = parseInt(babbageNum.toString().replace('269696', ")); let answer = 99736; // count down from this answer and save any sqrt int result. return lowest one diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/balanced-brackets.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/balanced-brackets.english.md index 252bd71047..762fdc2d96 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/balanced-brackets.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/balanced-brackets.english.md @@ -28,43 +28,43 @@ Examples: ```yml tests: - text: isBalanced is a function. - testString: 'assert(typeof isBalanced === ''function'', ''isBalanced is a function.'');' + testString: 'assert(typeof isBalanced === "function", "isBalanced is a function.");' - text: 'isBalanced("[]") should return true.' - testString: 'assert(isBalanced(testCases[0]), ''isBalanced("[]") should return true.'');' + testString: 'assert(isBalanced(testCases[0]), "isBalanced("[]") should return true.");' - text: 'isBalanced("]][[[][][][]][") should return false.' - testString: 'assert(!isBalanced(testCases[1]), ''isBalanced("]][[[][][][]][") should return false.'');' + testString: 'assert(!isBalanced(testCases[1]), "isBalanced("]][[[][][][]][") should return false.");' - text: 'isBalanced("[][[[[][][[[]]]]]]") should return true.' - testString: 'assert(isBalanced(testCases[2]), ''isBalanced("[][[[[][][[[]]]]]]") should return true.'');' + testString: 'assert(isBalanced(testCases[2]), "isBalanced("[][[[[][][[[]]]]]]") should return true.");' - text: 'isBalanced("][") should return true.' - testString: 'assert(!isBalanced(testCases[3]), ''isBalanced("][") should return true.'');' + testString: 'assert(!isBalanced(testCases[3]), "isBalanced("][") should return true.");' - text: 'isBalanced("[[[]]]][[]") should return true.' - testString: 'assert(!isBalanced(testCases[4]), ''isBalanced("[[[]]]][[]") should return true.'');' + testString: 'assert(!isBalanced(testCases[4]), "isBalanced("[[[]]]][[]") should return true.");' - text: 'isBalanced("][[]") should return true.' - testString: 'assert(!isBalanced(testCases[5]), ''isBalanced("][[]") should return true.'');' + testString: 'assert(!isBalanced(testCases[5]), "isBalanced("][[]") should return true.");' - text: 'isBalanced("][[][]][[[]]") should return true.' - testString: 'assert(!isBalanced(testCases[6]), ''isBalanced("][[][]][[[]]") should return true.'');' + testString: 'assert(!isBalanced(testCases[6]), "isBalanced("][[][]][[[]]") should return true.");' - text: 'isBalanced("[[][]]][") should return true.' - testString: 'assert(!isBalanced(testCases[7]), ''isBalanced("[[][]]][") should return true.'');' + testString: 'assert(!isBalanced(testCases[7]), "isBalanced("[[][]]][") should return true.");' - text: 'isBalanced("[[[]]][[]]]][][[") should return true.' - testString: 'assert(!isBalanced(testCases[8]), ''isBalanced("[[[]]][[]]]][][[") should return true.'');' + testString: 'assert(!isBalanced(testCases[8]), "isBalanced("[[[]]][[]]]][][[") should return true.");' - text: 'isBalanced("[]][[]]][[[[][]]") should return true.' - testString: 'assert(!isBalanced(testCases[9]), ''isBalanced("[]][[]]][[[[][]]") should return true.'');' + testString: 'assert(!isBalanced(testCases[9]), "isBalanced("[]][[]]][[[[][]]") should return true.");' - text: 'isBalanced("][]][[][") should return true.' - testString: 'assert(!isBalanced(testCases[10]), ''isBalanced("][]][[][") should return true.'');' + testString: 'assert(!isBalanced(testCases[10]), "isBalanced("][]][[][") should return true.");' - text: 'isBalanced("[[]][[][]]") should return true.' - testString: 'assert(isBalanced(testCases[11]), ''isBalanced("[[]][[][]]") should return true.'');' + testString: 'assert(isBalanced(testCases[11]), "isBalanced("[[]][[][]]") should return true.");' - text: 'isBalanced("[[]]") should return true.' - testString: 'assert(isBalanced(testCases[12]), ''isBalanced("[[]]") should return true.'');' + testString: 'assert(isBalanced(testCases[12]), "isBalanced("[[]]") should return true.");' - text: 'isBalanced("]][]][[]][[[") should return true.' - testString: 'assert(!isBalanced(testCases[13]), ''isBalanced("]][]][[]][[[") should return true.'');' + testString: 'assert(!isBalanced(testCases[13]), "isBalanced("]][]][[]][[[") should return true.");' - text: 'isBalanced("][]][][[") should return true.' - testString: 'assert(!isBalanced(testCases[14]), ''isBalanced("][]][][[") should return true.'');' + testString: 'assert(!isBalanced(testCases[14]), "isBalanced("][]][][[") should return true.");' - text: 'isBalanced("][][") should return true.' - testString: 'assert(!isBalanced(testCases[15]), ''isBalanced("][][") should return true.'');' + testString: 'assert(!isBalanced(testCases[15]), "isBalanced("][][") should return true.");' - text: 'isBalanced("[[]]][][][[]][") should return true.' - testString: 'assert(!isBalanced(testCases[16]), ''isBalanced("[[]]][][][[]][") should return true.'');' + testString: 'assert(!isBalanced(testCases[16]), "isBalanced("[[]]][][][[]][") should return true.");' - text: isBalanced("") should return true. - testString: 'assert(isBalanced(testCases[17]), ''isBalanced("") should return true.'');' + testString: 'assert(isBalanced(testCases[17]), "isBalanced("") should return true.");' ``` @@ -102,12 +102,12 @@ console.info('after the test'); ```js function isBalanced (str) { - if (str === '') return true; + if (str === ") return true; let a = str; let b; do { b = a; - a = a.replace(/\[\]/g, ''); + a = a.replace(/\[\]/g, "); } while (a !== b); return !a; } diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/circles-of-given-radius-through-two-points.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/circles-of-given-radius-through-two-points.english.md index 7a8c493cd3..3ea61c922c 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/circles-of-given-radius-through-two-points.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/circles-of-given-radius-through-two-points.english.md @@ -41,17 +41,17 @@ Ref: ```yml tests: - text: getCircles is a function. - testString: 'assert(typeof getCircles === ''function'', ''getCircles is a function.'');' + testString: 'assert(typeof getCircles === "function", "getCircles is a function.");' - text: 'getCircles([0.1234, 0.9876], [0.8765, 0.2345], 2.0) should return [[1.8631, 1.9742], [-0.8632, -0.7521]].' - testString: 'assert.deepEqual(getCircles(...testCases[0]), answers[0], ''getCircles([0.1234, 0.9876], [0.8765, 0.2345], 2.0) should return [[1.8631, 1.9742], [-0.8632, -0.7521]].'');' + testString: 'assert.deepEqual(getCircles(...testCases[0]), answers[0], "getCircles([0.1234, 0.9876], [0.8765, 0.2345], 2.0) should return [[1.8631, 1.9742], [-0.8632, -0.7521]].");' - text: 'getCircles([0.0000, 2.0000], [0.0000, 0.0000], 1.0) should return [0, 1]' - testString: 'assert.deepEqual(getCircles(...testCases[1]), answers[1], ''getCircles([0.0000, 2.0000], [0.0000, 0.0000], 1.0) should return [0, 1]'');' + testString: 'assert.deepEqual(getCircles(...testCases[1]), answers[1], "getCircles([0.0000, 2.0000], [0.0000, 0.0000], 1.0) should return [0, 1]");' - text: 'getCircles([0.1234, 0.9876], [0.1234, 0.9876], 2.0) should return Coincident point. Infinite solutions' - testString: 'assert.deepEqual(getCircles(...testCases[2]), answers[2], ''getCircles([0.1234, 0.9876], [0.1234, 0.9876], 2.0) should return Coincident point. Infinite solutions'');' + testString: 'assert.deepEqual(getCircles(...testCases[2]), answers[2], "getCircles([0.1234, 0.9876], [0.1234, 0.9876], 2.0) should return Coincident point. Infinite solutions");' - text: 'getCircles([0.1234, 0.9876], [0.8765, 0.2345], 0.5) should return No intersection. Points further apart than circle diameter' - testString: 'assert.deepEqual(getCircles(...testCases[3]), answers[3], ''getCircles([0.1234, 0.9876], [0.8765, 0.2345], 0.5) should return No intersection. Points further apart than circle diameter'');' + testString: 'assert.deepEqual(getCircles(...testCases[3]), answers[3], "getCircles([0.1234, 0.9876], [0.8765, 0.2345], 0.5) should return No intersection. Points further apart than circle diameter");' - text: 'getCircles([0.1234, 0.9876], [0.1234, 0.9876], 0.0) should return Radius Zero' - testString: 'assert.deepEqual(getCircles(...testCases[4]), answers[4], ''getCircles([0.1234, 0.9876], [0.1234, 0.9876], 0.0) should return Radius Zero'');' + testString: 'assert.deepEqual(getCircles(...testCases[4]), answers[4], "getCircles([0.1234, 0.9876], [0.1234, 0.9876], 0.0) should return Radius Zero");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/closest-pair-problem.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/closest-pair-problem.english.md index 645f5b11ee..516d0de767 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/closest-pair-problem.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/closest-pair-problem.english.md @@ -65,7 +65,7 @@ References and further readings: Closest Pair (McGill) Closest Pair (UCSB)
Closest pair (WUStL) - Closest pair (IUPUI) + Closest pair (IUPUI)

For the input, expect the argument to be an array of objects (points) with x and y members set to numbers. For the output, return an object containing the key:value pairs for distance and pair (i.e., the pair of two closest points).

@@ -80,15 +80,15 @@ References and further readings: ```yml tests: - text: getClosestPair is a function. - testString: 'assert(typeof getClosestPair === ''function'', ''getClosestPair is a function.'');' + testString: 'assert(typeof getClosestPair === "function", "getClosestPair is a function.");' - text: Distance should be the following. - testString: 'assert.equal(getClosestPair(points1).distance, answer1.distance, ''Distance should be the following.'');' + testString: 'assert.equal(getClosestPair(points1).distance, answer1.distance, "Distance should be the following.");' - text: Points should be the following. - testString: 'assert.deepEqual(JSON.parse(JSON.stringify(getClosestPair(points1))).pair, answer1.pair, ''Points should be the following.'');' + testString: 'assert.deepEqual(JSON.parse(JSON.stringify(getClosestPair(points1))).pair, answer1.pair, "Points should be the following.");' - text: Distance should be the following. - testString: 'assert.equal(getClosestPair(points2).distance, answer2.distance, ''Distance should be the following.'');' + testString: 'assert.equal(getClosestPair(points2).distance, answer2.distance, "Distance should be the following.");' - text: Points should be the following. - testString: 'assert.deepEqual(JSON.parse(JSON.stringify(getClosestPair(points2))).pair, answer2.pair, ''Points should be the following.'');' + testString: 'assert.deepEqual(JSON.parse(JSON.stringify(getClosestPair(points2))).pair, answer2.pair, "Points should be the following.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/combinations.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/combinations.english.md index bd09384eaf..0b991000ff 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/combinations.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/combinations.english.md @@ -35,11 +35,11 @@ Example: ```yml tests: - text: combinations is a function. - testString: 'assert(typeof combinations === ''function'', ''combinations is a function.'');' + testString: 'assert(typeof combinations === "function", "combinations is a function.");' - text: 'combinations(3, 5) should return [[0, 1, 2], [0, 1, 3], [0, 1, 4], [0, 2, 3], [0, 2, 4], [0, 3, 4], [1, 2, 3], [1, 2, 4], [1, 3, 4], [2, 3, 4]].' - testString: 'assert.deepEqual(combinations(testInput1[0], testInput1[1]), testOutput1, ''combinations(3, 5) should return [[0, 1, 2], [0, 1, 3], [0, 1, 4], [0, 2, 3], [0, 2, 4], [0, 3, 4], [1, 2, 3], [1, 2, 4], [1, 3, 4], [2, 3, 4]].'');' + testString: 'assert.deepEqual(combinations(testInput1[0], testInput1[1]), testOutput1, "combinations(3, 5) should return [[0, 1, 2], [0, 1, 3], [0, 1, 4], [0, 2, 3], [0, 2, 4], [0, 3, 4], [1, 2, 3], [1, 2, 4], [1, 3, 4], [2, 3, 4]].");' - text: 'combinations(4, 6) should return [[0,1,2,3], [0,1,2,4], [0,1,2,5], [0,1,3,4], [0,1,3,5], [0,1,4,5], [0,2,3,4], [0,2,3,5], [0,2,4,5], [0,3,4,5], [1,2,3,4], [1,2,3,5], [1,2,4,5], [1,3,4,5], [2,3,4,5]]' - testString: 'assert.deepEqual(combinations(testInput2[0], testInput2[1]), testOutput2, ''combinations(4, 6) should return [[0,1,2,3], [0,1,2,4], [0,1,2,5], [0,1,3,4], [0,1,3,5], [0,1,4,5], [0,2,3,4], [0,2,3,5], [0,2,4,5], [0,3,4,5], [1,2,3,4], [1,2,3,5], [1,2,4,5], [1,3,4,5], [2,3,4,5]]'');' + testString: 'assert.deepEqual(combinations(testInput2[0], testInput2[1]), testOutput2, "combinations(4, 6) should return [[0,1,2,3], [0,1,2,4], [0,1,2,5], [0,1,3,4], [0,1,3,5], [0,1,4,5], [0,2,3,4], [0,2,3,5], [0,2,4,5], [0,3,4,5], [1,2,3,4], [1,2,3,5], [1,2,4,5], [1,3,4,5], [2,3,4,5]]");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/comma-quibbling.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/comma-quibbling.english.md index a3cb467af5..bc78431159 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/comma-quibbling.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/comma-quibbling.english.md @@ -31,17 +31,17 @@ An input of three or more words, e.g. ["ABC", "DEF", "G", "H"], produces the out ```yml tests: - text: quibble is a function. - testString: 'assert(typeof quibble === ''function'', ''quibble is a function.'');' + testString: 'assert(typeof quibble === "function", "quibble is a function.");' - text: 'quibble(["ABC"]) should return a string.' - testString: 'assert(typeof quibble(["ABC"]) === ''string'', ''quibble(["ABC"]) should return a string.'');' + testString: 'assert(typeof quibble(["ABC"]) === "string", "quibble(["ABC"]) should return a string.");' - text: 'quibble([]) should return "{}".' - testString: 'assert.equal(quibble(testCases[0]), results[0], ''quibble([]) should return "{}".'');' + testString: 'assert.equal(quibble(testCases[0]), results[0], "quibble([]) should return "{}".");' - text: 'quibble(["ABC"]) should return "{ABC}".' - testString: 'assert.equal(quibble(testCases[1]), results[1], ''quibble(["ABC"]) should return "{ABC}".'');' + testString: 'assert.equal(quibble(testCases[1]), results[1], "quibble(["ABC"]) should return "{ABC}".");' - text: 'quibble(["ABC", "DEF"]) should return "{ABC and DEF}".' - testString: 'assert.equal(quibble(testCases[2]), results[2], ''quibble(["ABC", "DEF"]) should return "{ABC and DEF}".'');' + testString: 'assert.equal(quibble(testCases[2]), results[2], "quibble(["ABC", "DEF"]) should return "{ABC and DEF}".");' - text: 'quibble(["ABC", "DEF", "G", "H"]) should return "{ABC,DEF,G and H}".' - testString: 'assert.equal(quibble(testCases[3]), results[3], ''quibble(["ABC", "DEF", "G", "H"]) should return "{ABC,DEF,G and H}".'');' + testString: 'assert.equal(quibble(testCases[3]), results[3], "quibble(["ABC", "DEF", "G", "H"]) should return "{ABC,DEF,G and H}".");' ``` @@ -82,7 +82,7 @@ function quibble (words) { return "{" + words.slice(0, words.length - 1).join(",") + (words.length > 1 ? " and " : "") + - (words[words.length - 1] || '') + + (words[words.length - 1] || ") + "}"; } diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/compare-a-list-of-strings.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/compare-a-list-of-strings.english.md index 48fbb2dffc..88174bca5a 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/compare-a-list-of-strings.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/compare-a-list-of-strings.english.md @@ -21,29 +21,29 @@ challengeType: 5 ```yml tests: - text: allEqual is a function. - testString: 'assert(typeof allEqual === ''function'', ''allEqual is a function.'');' + testString: 'assert(typeof allEqual === "function", "allEqual is a function.");' - text: azSorted is a function. - testString: 'assert(typeof azSorted === ''function'', ''azSorted is a function.'');' + testString: 'assert(typeof azSorted === "function", "azSorted is a function.");' - text: 'allEqual(["AA", "AA", "AA", "AA"]) returns true.' - testString: 'assert(allEqual(testCases[0]), ''allEqual(["AA", "AA", "AA", "AA"]) returns true.'');' + testString: 'assert(allEqual(testCases[0]), "allEqual(["AA", "AA", "AA", "AA"]) returns true.");' - text: 'azSorted(["AA", "AA", "AA", "AA"]) returns false.' - testString: 'assert(!azSorted(testCases[0]), ''azSorted(["AA", "AA", "AA", "AA"]) returns false.'');' + testString: 'assert(!azSorted(testCases[0]), "azSorted(["AA", "AA", "AA", "AA"]) returns false.");' - text: 'allEqual(["AA", "ACB", "BB", "CC"]) returns false.' - testString: 'assert(!allEqual(testCases[1]), ''allEqual(["AA", "ACB", "BB", "CC"]) returns false.'');' + testString: 'assert(!allEqual(testCases[1]), "allEqual(["AA", "ACB", "BB", "CC"]) returns false.");' - text: 'azSorted(["AA", "ACB", "BB", "CC"]) returns true.' - testString: 'assert(azSorted(testCases[1]), ''azSorted(["AA", "ACB", "BB", "CC"]) returns true.'');' + testString: 'assert(azSorted(testCases[1]), "azSorted(["AA", "ACB", "BB", "CC"]) returns true.");' - text: 'allEqual([]) returns true.' - testString: 'assert(allEqual(testCases[2]), ''allEqual([]) returns true.'');' + testString: 'assert(allEqual(testCases[2]), "allEqual([]) returns true.");' - text: 'azSorted([]) returns true.' - testString: 'assert(azSorted(testCases[2]), ''azSorted([]) returns true.'');' + testString: 'assert(azSorted(testCases[2]), "azSorted([]) returns true.");' - text: 'allEqual(["AA"]) returns true.' - testString: 'assert(allEqual(testCases[3]), ''allEqual(["AA"]) returns true.'');' + testString: 'assert(allEqual(testCases[3]), "allEqual(["AA"]) returns true.");' - text: 'azSorted(["AA"]) returns true.' - testString: 'assert(azSorted(testCases[3]), ''azSorted(["AA"]) returns true.'');' + testString: 'assert(azSorted(testCases[3]), "azSorted(["AA"]) returns true.");' - text: 'allEqual(["BB", "AA"]) returns false.' - testString: 'assert(!allEqual(testCases[4]), ''allEqual(["BB", "AA"]) returns false.'');' + testString: 'assert(!allEqual(testCases[4]), "allEqual(["BB", "AA"]) returns false.");' - text: 'azSorted(["BB", "AA"]) returns false.' - testString: 'assert(!azSorted(testCases[4]), ''azSorted(["BB", "AA"]) returns false.'');' + testString: 'assert(!azSorted(testCases[4]), "azSorted(["BB", "AA"]) returns false.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/convert-seconds-to-compound-duration.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/convert-seconds-to-compound-duration.english.md index e10f63ff45..d48b3e3fe1 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/convert-seconds-to-compound-duration.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/convert-seconds-to-compound-duration.english.md @@ -82,13 +82,13 @@ However, only include quantities with non-zero values in the output (e.g., retur ```yml tests: - text: convertSeconds is a function. - testString: 'assert(typeof convertSeconds === ''function'', ''convertSeconds is a function.'');' + testString: 'assert(typeof convertSeconds === "function", "convertSeconds is a function.");' - text: 'convertSeconds(7259) should return 2 hr, 59 sec.' - testString: 'assert.equal(convertSeconds(testCases[0]), results[0], ''convertSeconds(7259) should return 2 hr, 59 sec.'');' + testString: 'assert.equal(convertSeconds(testCases[0]), results[0], "convertSeconds(7259) should return 2 hr, 59 sec.");' - text: convertSeconds(86400) should return 1 d. - testString: 'assert.equal(convertSeconds(testCases[1]), results[1], ''convertSeconds(86400) should return 1 d.'');' + testString: 'assert.equal(convertSeconds(testCases[1]), results[1], "convertSeconds(86400) should return 1 d.");' - text: 'convertSeconds(6000000) should return 9 wk, 6 d, 10 hr, 40 min.' - testString: 'assert.equal(convertSeconds(testCases[2]), results[2], ''convertSeconds(6000000) should return 9 wk, 6 d, 10 hr, 40 min.'');' + testString: 'assert.equal(convertSeconds(testCases[2]), results[2], "convertSeconds(6000000) should return 9 wk, 6 d, 10 hr, 40 min.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/count-occurrences-of-a-substring.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/count-occurrences-of-a-substring.english.md index 4c5192d465..59cc6ac216 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/count-occurrences-of-a-substring.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/count-occurrences-of-a-substring.english.md @@ -25,13 +25,13 @@ the second a substring to be searched for. ```yml tests: - text: countSubstring is a function. - testString: 'assert(typeof countSubstring === ''function'', ''countSubstring is a function.'');' + testString: 'assert(typeof countSubstring === "function", "countSubstring is a function.");' - text: 'countSubstring("the three truths", "th") should return 3.' - testString: 'assert.equal(countSubstring(testCases[0], searchString[0]), results[0], ''countSubstring("the three truths", "th") should return 3.'');' + testString: 'assert.equal(countSubstring(testCases[0], searchString[0]), results[0], "countSubstring("the three truths", "th") should return 3.");' - text: 'countSubstring("ababababab", "abab") should return 2.' - testString: 'assert.equal(countSubstring(testCases[1], searchString[1]), results[1], ''countSubstring("ababababab", "abab") should return 2.'');' + testString: 'assert.equal(countSubstring(testCases[1], searchString[1]), results[1], "countSubstring("ababababab", "abab") should return 2.");' - text: 'countSubstring("abaabba*bbaba*bbab", "a*b") should return 2.' - testString: 'assert.equal(countSubstring(testCases[2], searchString[2]), results[2], ''countSubstring("abaabba*bbaba*bbab", "a*b") should return 2.'');' + testString: 'assert.equal(countSubstring(testCases[2], searchString[2]), results[2], "countSubstring("abaabba*bbaba*bbab", "a*b") should return 2.");' ``` 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 4a15bd17c4..9c8349b4b4 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 @@ -9,10 +9,10 @@ challengeType: 5

There are four types of common coins in US currency:

quarters (25 cents) dimes (10 cents) -nickels (5 cents), and -pennies (1 cent) +nickels (5 cents), and +pennies (1 cent)

There are six ways to make change for 15 cents:

-A dime and a nickel +A dime and a nickel A dime and 5 pennies 3 nickels 2 nickels and 5 pennies @@ -21,7 +21,7 @@ A nickel and 10 pennies Task:

Implement a function to determine how many ways there are to make change for a dollar using these common coins? (1 dollar = 100 cents).

Reference: - an algorithm from MIT Press. + an algorithm from MIT Press.
## Instructions @@ -35,9 +35,9 @@ Reference: ```yml tests: - text: countCoins is a function. - testString: 'assert(typeof countCoins === ''function'', ''countCoins is a function.'');' + testString: 'assert(typeof countCoins === "function", "countCoins is a function.");' - text: countCoints() should return 242. - testString: 'assert.equal(countCoins(), 242, ''countCoints() should return 242.'');' + testString: 'assert.equal(countCoins(), 242, "countCoints() should return 242.");' ``` 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 fdfd6960ec..57e2faef21 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 @@ -38,11 +38,11 @@ w+3x+3y-z=-47 \\ ```yml tests: - text: cramersRule is a function. - testString: 'assert(typeof cramersRule === ''function'', ''cramersRule is a function.'');' + testString: 'assert(typeof cramersRule === "function", "cramersRule is a function.");' - text: 'cramersRule([[2, -1, 5, 1], [3, 2, 2, -6], [1, 3, 3, -1], [5, -2, -3, 3]], [-3, -32, -47, 49]) should return [2, -12, -4, 1].' - testString: 'assert.deepEqual(cramersRule(matrices[0], freeTerms[0]), answers[0], ''cramersRule([[2, -1, 5, 1], [3, 2, 2, -6], [1, 3, 3, -1], [5, -2, -3, 3]], [-3, -32, -47, 49]) should return [2, -12, -4, 1].'');' + testString: 'assert.deepEqual(cramersRule(matrices[0], freeTerms[0]), answers[0], "cramersRule([[2, -1, 5, 1], [3, 2, 2, -6], [1, 3, 3, -1], [5, -2, -3, 3]], [-3, -32, -47, 49]) should return [2, -12, -4, 1].");' - text: 'cramersRule([[3, 1, 1], [2, 2, 5], [1, -3, -4]], [3, -1, 2]) should return [1, 1, -1].' - testString: 'assert.deepEqual(cramersRule(matrices[1], freeTerms[1]), answers[1], ''cramersRule([[3, 1, 1], [2, 2, 5], [1, -3, -4]], [3, -1, 2]) should return [1, 1, -1].'');' + testString: 'assert.deepEqual(cramersRule(matrices[1], freeTerms[1]), answers[1], "cramersRule([[3, 1, 1], [2, 2, 5], [1, -3, -4]], [3, -1, 2]) should return [1, 1, -1].");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/date-format.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/date-format.english.md index 0ed29b97bf..34d7a88cc3 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/date-format.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/date-format.english.md @@ -24,11 +24,11 @@ Task: ```yml tests: - text: getDateFormats is a function. - testString: 'assert(typeof getDateFormats === ''function'', ''getDateFormats is a function.'');' + testString: 'assert(typeof getDateFormats === "function", "getDateFormats is a function.");' - text: Should return an object. - testString: 'assert(typeof getDateFormats() === ''object'', ''Should return an object.'');' + testString: 'assert(typeof getDateFormats() === "object", "Should return an object.");' - text: Should returned an array with 2 elements. - testString: 'assert(getDateFormats().length === 2, ''Should returned an array with 2 elements.'');' + testString: 'assert(getDateFormats().length === 2, "Should returned an array with 2 elements.");' - text: Should return the correct date in the right format testString: 'assert.deepEqual(getDateFormats(), dates, equalsMessage);' diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/date-manipulation.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/date-manipulation.english.md index ac9536dea1..e413fdc71e 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/date-manipulation.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/date-manipulation.english.md @@ -26,19 +26,19 @@ Task: ```yml tests: - text: add12Hours is a function. - testString: 'assert(typeof add12Hours === ''function'', ''add12Hours is a function.'');' + testString: 'assert(typeof add12Hours === "function", "add12Hours is a function.");' - text: add12Hours(dateString) should return a string. - testString: 'assert(typeof add12Hours(tests[0]) === ''string'', ''add12Hours(dateString) should return a string.'');' - - text: 'add12Hours("'' + tests[0] + ''") should return "'' + answers[0] + ''"' - testString: 'assert(add12Hours(tests[0]) === answers[0], ''add12Hours("'' + tests[0] + ''") should return "'' + answers[0] + ''"'');' - - text: 'Should handel day change. add12Hours("'' + tests[1] + ''") should return "'' + answers[1] + ''"' - testString: 'assert(add12Hours(tests[1]) === answers[1], ''Should handel day change. add12Hours("'' + tests[1] + ''") should return "'' + answers[1] + ''"'');' - - text: 'Should handel month change in a leap years. add12Hours("'' + tests[2] + ''") should return "'' + answers[2] + ''"' - testString: 'assert(add12Hours(tests[2]) === answers[2], ''Should handel month change in a leap years. add12Hours("'' + tests[2] + ''") should return "'' + answers[2] + ''"'');' - - text: 'Should handel month change in a common years. add12Hours("'' + tests[3] + ''") should return "'' + answers[3] + ''"' - testString: 'assert(add12Hours(tests[3]) === answers[3], ''Should handel month change in a common years. add12Hours("'' + tests[3] + ''") should return "'' + answers[3] + ''"'');' - - text: 'Should handel year change. add12Hours("'' + tests[4] + ''") should return "'' + answers[4] + ''"' - testString: 'assert(add12Hours(tests[4]) === answers[4], ''Should handel year change. add12Hours("'' + tests[4] + ''") should return "'' + answers[4] + ''"'');' + testString: 'assert(typeof add12Hours(tests[0]) === "string", "add12Hours(dateString) should return a string.");' + - text: 'add12Hours("" + tests[0] + "") should return "" + answers[0] + ""' + testString: 'assert(add12Hours(tests[0]) === answers[0], "add12Hours("" + tests[0] + "") should return "" + answers[0] + """);' + - text: 'Should handel day change. add12Hours("" + tests[1] + "") should return "" + answers[1] + ""' + testString: 'assert(add12Hours(tests[1]) === answers[1], "Should handel day change. add12Hours("" + tests[1] + "") should return "" + answers[1] + """);' + - text: 'Should handel month change in a leap years. add12Hours("" + tests[2] + "") should return "" + answers[2] + ""' + testString: 'assert(add12Hours(tests[2]) === answers[2], "Should handel month change in a leap years. add12Hours("" + tests[2] + "") should return "" + answers[2] + """);' + - text: 'Should handel month change in a common years. add12Hours("" + tests[3] + "") should return "" + answers[3] + ""' + testString: 'assert(add12Hours(tests[3]) === answers[3], "Should handel month change in a common years. add12Hours("" + tests[3] + "") should return "" + answers[3] + """);' + - text: 'Should handel year change. add12Hours("" + tests[4] + "") should return "" + answers[4] + ""' + testString: 'assert(add12Hours(tests[4]) === answers[4], "Should handel year change. add12Hours("" + tests[4] + "") should return "" + answers[4] + """);' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/day-of-the-week.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/day-of-the-week.english.md index d45d5d2242..68d2f11830 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/day-of-the-week.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/day-of-the-week.english.md @@ -22,13 +22,13 @@ challengeType: 5 ```yml tests: - text: findXmasSunday is a function. - testString: 'assert(typeof findXmasSunday === ''function'', ''findXmasSunday is a function.'');' + testString: 'assert(typeof findXmasSunday === "function", "findXmasSunday is a function.");' - text: 'findChristmasSunday(2000, 2100) should return an array.' - testString: 'assert(typeof findXmasSunday(2000, 2100) === ''object'', ''findChristmasSunday(2000, 2100) should return an array.'');' + testString: 'assert(typeof findXmasSunday(2000, 2100) === "object", "findChristmasSunday(2000, 2100) should return an array.");' - text: 'findChristmasSunday(2008, 2121 should return [1977, 1983, 1988, 1994, 2005, 2011, 2016]' - testString: 'assert.deepEqual(findXmasSunday(1970, 2017), firstSolution, ''findChristmasSunday(2008, 2121 should return [1977, 1983, 1988, 1994, 2005, 2011, 2016]'');' + testString: 'assert.deepEqual(findXmasSunday(1970, 2017), firstSolution, "findChristmasSunday(2008, 2121 should return [1977, 1983, 1988, 1994, 2005, 2011, 2016]");' - text: 'findChristmasSunday(2008, 2121 should return [2011, 2016, 2022, 2033, 2039, 2044, 2050, 2061, 2067, 2072, 2078, 2089, 2095, 2101, 2107, 2112, 2118]' - testString: 'assert.deepEqual(findXmasSunday(2008, 2121), secondSolution, ''findChristmasSunday(2008, 2121 should return [2011, 2016, 2022, 2033, 2039, 2044, 2050, 2061, 2067, 2072, 2078, 2089, 2095, 2101, 2107, 2112, 2118]'');' + testString: 'assert.deepEqual(findXmasSunday(2008, 2121), secondSolution, "findChristmasSunday(2008, 2121 should return [2011, 2016, 2022, 2033, 2039, 2044, 2050, 2061, 2067, 2072, 2078, 2089, 2095, 2101, 2107, 2112, 2118]");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/deal-cards-for-freecell.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/deal-cards-for-freecell.english.md index 4c9ec11294..9f6b66c5a7 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/deal-cards-for-freecell.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/deal-cards-for-freecell.english.md @@ -15,7 +15,7 @@ $rand_n$ is in range 0 to 32767.

The algorithm follows:

Seed the RNG with the number of the deal. 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). + Choose a random card at index ≡ next random number (mod array length). Swap this random card with the last card of the array. Remove this random card from the array. (Array length goes down by 1.) Deal this random card. @@ -67,15 +67,15 @@ Task: ```yml tests: - text: dealFreeCell is a function. - testString: 'assert(typeof dealFreeCell === ''function'', ''dealFreeCell is a function.'');' + testString: 'assert(typeof dealFreeCell === "function", "dealFreeCell is a function.");' - text: dealFreeCell(seed) should return an object. - testString: 'assert(typeof dealFreeCell(1) === ''object'', ''dealFreeCell(seed) should return an object.'');' + testString: 'assert(typeof dealFreeCell(1) === "object", "dealFreeCell(seed) should return an object.");' - text: dealFreeCell(seed) should return an array of length 7. - testString: 'assert(dealFreeCell(1).length === 7, ''dealFreeCell(seed) should return an array of length 7.'');' + testString: 'assert(dealFreeCell(1).length === 7, "dealFreeCell(seed) should return an array of length 7.");' - text: 'dealFreeCell(1) should return an array identical to example "Game #1"' - testString: 'assert.deepEqual(dealFreeCell(1), game1, ''dealFreeCell(1) should return an array identical to example "Game #1"'');' + testString: 'assert.deepEqual(dealFreeCell(1), game1, "dealFreeCell(1) should return an array identical to example "Game #1"");' - text: 'dealFreeCell(617) should return an array identical to example "Game #617"' - testString: 'assert.deepEqual(dealFreeCell(617), game617, ''dealFreeCell(617) should return an array identical to example "Game #617"'');' + testString: 'assert.deepEqual(dealFreeCell(617), game617, "dealFreeCell(617) should return an array identical to example "Game #617"");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/deepcopy.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/deepcopy.english.md index af60be3c26..fde981b3ec 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/deepcopy.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/deepcopy.english.md @@ -27,15 +27,15 @@ Prototype copying ```yml tests: - text: deepcopy should be a function. - testString: 'assert(typeof deepcopy === ''function'', ''deepcopy should be a function.'');' + testString: 'assert(typeof deepcopy === "function", "deepcopy should be a function.");' - text: 'deepcopy({test: "test"}) should return an object.' - testString: 'assert(typeof deepcopy(obj1) === ''object'', ''deepcopy({test: "test"}) should return an object.'');' + testString: 'assert(typeof deepcopy(obj1) === "object", "deepcopy({test: "test"}) should return an object.");' - text: Should not return the same object that was provided. - testString: 'assert(deepcopy(obj2) != obj2, ''Should not return the same object that was provided.'');' + testString: 'assert(deepcopy(obj2) != obj2, "Should not return the same object that was provided.");' - text: 'When passed an object containing an array, should return a deep copy of the object.' - testString: 'assert.deepEqual(deepcopy(obj2), obj2, ''When passed an object containing an array, should return a deep copy of the object.'');' + testString: 'assert.deepEqual(deepcopy(obj2), obj2, "When passed an object containing an array, should return a deep copy of the object.");' - text: 'When passed an object containing another object, should return a deep copy of the object.' - testString: 'assert.deepEqual(deepcopy(obj3), obj3, ''When passed an object containing another object, should return a deep copy of the object.'');' + testString: 'assert.deepEqual(deepcopy(obj3), obj3, "When passed an object containing another object, should return a deep copy of the object.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/define-a-primitive-data-type.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/define-a-primitive-data-type.english.md index 074f918fad..b90307836b 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/define-a-primitive-data-type.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/define-a-primitive-data-type.english.md @@ -26,33 +26,33 @@ it should throw a TypeError with an error message of 'Not a N ```yml tests: - text: Num should be a function. - testString: 'assert(typeof Num === ''function'', ''Num should be a function.'');' + testString: 'assert(typeof Num === "function", "Num should be a function.");' - text: new Num(4) should return an object. - testString: 'assert(typeof (new Num(4)) === ''object'', ''new Num(4) should return an object.'');' + testString: 'assert(typeof (new Num(4)) === "object", "new Num(4) should return an object.");' - text: new Num(\'test\') should throw a TypeError with message \'Not a Number\'. - testString: 'assert(throws(() => new Num(''test''), TypeError, ''Not a Number''), ''new Num(\''test\'') should throw a TypeError with message \''Not a Number\''.'');' + testString: 'assert(throws(() => new Num("test"), TypeError, "Not a Number"), "new Num(\"test\") should throw a TypeError with message \"Not a Number\".");' - text: new Num(0) should throw a TypeError with message \'Out of range\'. - testString: 'assert(throws(() => new Num(0), TypeError, ''Out of range''), ''new Num(0) should throw a TypeError with message \''Out of range\''.'');' + testString: 'assert(throws(() => new Num(0), TypeError, "Out of range"), "new Num(0) should throw a TypeError with message \"Out of range\".");' - text: new Num(-5) should throw a TypeError with message \'Out of range\'. - testString: 'assert(throws(() => new Num(-5), TypeError, ''Out of range''), ''new Num(-5) should throw a TypeError with message \''Out of range\''.'');' + testString: 'assert(throws(() => new Num(-5), TypeError, "Out of range"), "new Num(-5) should throw a TypeError with message \"Out of range\".");' - text: new Num(10) should throw a TypeError with message \'Out of range\'. - testString: 'assert(throws(() => new Num(11), TypeError, ''Out of range''), ''new Num(10) should throw a TypeError with message \''Out of range\''.'');' + testString: 'assert(throws(() => new Num(11), TypeError, "Out of range"), "new Num(10) should throw a TypeError with message \"Out of range\".");' - text: new Num(20) should throw a TypeError with message \'Out of range\'. - testString: 'assert(throws(() => new Num(20), TypeError, ''Out of range''), ''new Num(20) should throw a TypeError with message \''Out of range\''.'');' + testString: 'assert(throws(() => new Num(20), TypeError, "Out of range"), "new Num(20) should throw a TypeError with message \"Out of range\".");' - text: new Num(3) + new Num(4) should equal 7. - testString: 'assert.equal(new Num(3) + new Num(4), 7, ''new Num(3) + new Num(4) should equal 7.'');' + testString: 'assert.equal(new Num(3) + new Num(4), 7, "new Num(3) + new Num(4) should equal 7.");' - text: new Num(3) - new Num(4) should equal -1. - testString: 'assert.equal(new Num(3) - new Num(4), -1, ''new Num(3) - new Num(4) should equal -1.'');' + testString: 'assert.equal(new Num(3) - new Num(4), -1, "new Num(3) - new Num(4) should equal -1.");' - text: new Num(3) * new Num(4) should equal 12. - testString: 'assert.equal(new Num(3) * new Num(4), 12, ''new Num(3) * new Num(4) should equal 12.'');' + testString: 'assert.equal(new Num(3) * new Num(4), 12, "new Num(3) * new Num(4) should equal 12.");' - text: new Num(3) / new Num(4) should equal 0.75. - testString: 'assert.equal(new Num(3) / new Num(4), 0.75, ''new Num(3) / new Num(4) should equal 0.75.'');' + testString: 'assert.equal(new Num(3) / new Num(4), 0.75, "new Num(3) / new Num(4) should equal 0.75.");' - text: new Num(3) < new Num(4) should be true. - testString: 'assert(new Num(3) < new Num(4), ''new Num(3) < new Num(4) should be true.'');' + testString: 'assert(new Num(3) < new Num(4), "new Num(3) < new Num(4) should be true.");' - text: new Num(3) > new Num(4) should be false. - testString: 'assert(!(new Num(3) > new Num(4)), ''new Num(3) > new Num(4) should be false.'');' + testString: 'assert(!(new Num(3) > new Num(4)), "new Num(3) > new Num(4) should be false.");' - text: (new Num(5)).toString() should return \'5\' - testString: 'assert.equal((new Num(5)).toString(), ''5'', ''(new Num(5)).toString() should return \''5\'''');' + testString: 'assert.equal((new Num(5)).toString(), "5", "(new Num(5)).toString() should return \"5\"");' ``` @@ -97,7 +97,7 @@ Num.prototype.toString = function () { return this._value.toString(); }; function throws(func, errorType, msg) { let hasThrown = false; - let errorMsg = ''; + let errorMsg = "; let correctType = false; try { func(); 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 64cd3fa933..0382778c21 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 @@ -9,7 +9,7 @@ challengeType: 5

There is a highly organized city that has decided to assign a number to each of their departments:

Police department Sanitation department -Fire department +Fire department

Each department can have a number between 1 and 7 (inclusive).

The three department numbers are to be unique (different from each other) and must add up to the number 12.

The Chief of the Police doesn't like odd numbers and wants to have an even number for his department.

Task:

Write a program which outputs all valid combinations:

@@ -40,13 +40,13 @@ Task: ```yml tests: - text: combinations should be a function. - testString: 'assert(typeof combinations === ''function'', ''combinations should be a function.'');' + testString: 'assert(typeof combinations === "function", "combinations should be a function.");' - text: 'combinations([1, 2, 3], 6) should return an Array.' - testString: 'assert(Array.isArray(combinations([1, 2, 3], 6)), ''combinations([1, 2, 3], 6) should return an Array.'');' + testString: 'assert(Array.isArray(combinations([1, 2, 3], 6)), "combinations([1, 2, 3], 6) should return an Array.");' - text: 'combinations([1, 2, 3, 4, 5, 6, 7], 12) should return an array of length 14.' - testString: 'assert(combinations(nums, total).length === len, ''combinations([1, 2, 3, 4, 5, 6, 7], 12) should return an array of length 14.'');' + testString: 'assert(combinations(nums, total).length === len, "combinations([1, 2, 3, 4, 5, 6, 7], 12) should return an array of length 14.");' - text: 'combinations([1, 2, 3, 4, 5, 6, 7], 12) should return all valid combinations.' - testString: 'assert.deepEqual(combinations(nums, total), result, ''combinations([1, 2, 3, 4, 5, 6, 7], 12) should return all valid combinations.'');' + testString: 'assert.deepEqual(combinations(nums, total), result, "combinations([1, 2, 3, 4, 5, 6, 7], 12) should return all valid combinations.");' ``` 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 d7f8af3dc7..5fa1165b88 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 @@ -21,21 +21,21 @@ Task: ```yml tests: - text: discordianDate is a function. - testString: 'assert(typeof discordianDate === ''function'', ''discordianDate is a function.'');' + testString: 'assert(typeof discordianDate === "function", "discordianDate is a function.");' - text: 'discordianDate(new Date(2010, 6, 22)) should return "Pungenday, the 57th day of Confusion in the YOLD 3176".' - testString: 'assert(discordianDate(new Date(2010, 6, 22)) === ''Pungenday, the 57th day of Confusion in the YOLD 3176'', ''discordianDate(new Date(2010, 6, 22)) should return "Pungenday, the 57th day of Confusion in the YOLD 3176".'');' + testString: 'assert(discordianDate(new Date(2010, 6, 22)) === "Pungenday, the 57th day of Confusion in the YOLD 3176", "discordianDate(new Date(2010, 6, 22)) should return "Pungenday, the 57th day of Confusion in the YOLD 3176".");' - text: 'discordianDate(new Date(2012, 1, 28)) should return "Prickle-Prickle, the 59th day of Chaos in the YOLD 3178".' - testString: 'assert(discordianDate(new Date(2012, 1, 28)) === ''Prickle-Prickle, the 59th day of Chaos in the YOLD 3178'', ''discordianDate(new Date(2012, 1, 28)) should return "Prickle-Prickle, the 59th day of Chaos in the YOLD 3178".'');' - - text: 'discordianDate(new Date(2012, 1, 29)) should return "Setting Orange, the 60th day of Chaos in the YOLD 3178. Celebrate St. Tib\''s Day!".' - testString: 'assert(discordianDate(new Date(2012, 1, 29)) === ''Setting Orange, the 60th day of Chaos in the YOLD 3178. Celebrate St. Tib\''s Day!'', ''discordianDate(new Date(2012, 1, 29)) should return "Setting Orange, the 60th day of Chaos in the YOLD 3178. Celebrate St. Tib\''s Day!".'');' + testString: 'assert(discordianDate(new Date(2012, 1, 28)) === "Prickle-Prickle, the 59th day of Chaos in the YOLD 3178", "discordianDate(new Date(2012, 1, 28)) should return "Prickle-Prickle, the 59th day of Chaos in the YOLD 3178".");' + - text: 'discordianDate(new Date(2012, 1, 29)) should return "Setting Orange, the 60th day of Chaos in the YOLD 3178. Celebrate St. Tib\"s Day!".' + testString: 'assert(discordianDate(new Date(2012, 1, 29)) === "Setting Orange, the 60th day of Chaos in the YOLD 3178. Celebrate St. Tib\"s Day!", "discordianDate(new Date(2012, 1, 29)) should return "Setting Orange, the 60th day of Chaos in the YOLD 3178. Celebrate St. Tib\"s Day!".");' - text: 'discordianDate(new Date(2012, 2, 1)) should return "Setting Orange, the 60th day of Chaos in the YOLD 3178".' - testString: 'assert(discordianDate(new Date(2012, 2, 1)) === ''Setting Orange, the 60th day of Chaos in the YOLD 3178'', ''discordianDate(new Date(2012, 2, 1)) should return "Setting Orange, the 60th day of Chaos in the YOLD 3178".'');' + testString: 'assert(discordianDate(new Date(2012, 2, 1)) === "Setting Orange, the 60th day of Chaos in the YOLD 3178", "discordianDate(new Date(2012, 2, 1)) should return "Setting Orange, the 60th day of Chaos in the YOLD 3178".");' - text: 'discordianDate(new Date(2010, 0, 5)) should return "Setting Orange, the 5th day of Chaos in the YOLD 3176. Celebrate Mungday!".' - testString: 'assert(discordianDate(new Date(2010, 0, 5)) === ''Setting Orange, the 5th day of Chaos in the YOLD 3176. Celebrate Mungday!'', ''discordianDate(new Date(2010, 0, 5)) should return "Setting Orange, the 5th day of Chaos in the YOLD 3176. Celebrate Mungday!".'');' + testString: 'assert(discordianDate(new Date(2010, 0, 5)) === "Setting Orange, the 5th day of Chaos in the YOLD 3176. Celebrate Mungday!", "discordianDate(new Date(2010, 0, 5)) should return "Setting Orange, the 5th day of Chaos in the YOLD 3176. Celebrate Mungday!".");' - text: 'discordianDate(new Date(2011, 4, 3)) should return "Pungenday, the 50th day of Discord in the YOLD 3177. Celebrate Discoflux!".' - testString: 'assert(discordianDate(new Date(2011, 4, 3)) === ''Pungenday, the 50th day of Discord in the YOLD 3177. Celebrate Discoflux!'', ''discordianDate(new Date(2011, 4, 3)) should return "Pungenday, the 50th day of Discord in the YOLD 3177. Celebrate Discoflux!".'');' + testString: 'assert(discordianDate(new Date(2011, 4, 3)) === "Pungenday, the 50th day of Discord in the YOLD 3177. Celebrate Discoflux!", "discordianDate(new Date(2011, 4, 3)) should return "Pungenday, the 50th day of Discord in the YOLD 3177. Celebrate Discoflux!".");' - text: 'discordianDate(new Date(2015, 9, 19)) should return "Boomtime, the 73rd day of Bureaucracy in the YOLD 3181".' - testString: 'assert(discordianDate(new Date(2015, 9, 19)) === ''Boomtime, the 73rd day of Bureaucracy in the YOLD 3181'', ''discordianDate(new Date(2015, 9, 19)) should return "Boomtime, the 73rd day of Bureaucracy in the YOLD 3181".'');' + testString: 'assert(discordianDate(new Date(2015, 9, 19)) === "Boomtime, the 73rd day of Bureaucracy in the YOLD 3181", "discordianDate(new Date(2015, 9, 19)) should return "Boomtime, the 73rd day of Bureaucracy in the YOLD 3181".");' ``` @@ -153,12 +153,12 @@ function discordianDate(date) { : (seasonDay % 10 === 3) ? 'rd' : 'th'; - return '' + return " + dayOfWeek + ', the ' + seasonDay + nth + ' day of ' + season + ' in the YOLD ' + yold - + (celebrateHoliday ? '. Celebrate ' + celebrateHoliday + '!' : '') + + (celebrateHoliday ? '. Celebrate ' + celebrateHoliday + '!' : ") ; } diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/element-wise-operations.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/element-wise-operations.english.md index 036d31aad2..1c21ed21b5 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/element-wise-operations.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/element-wise-operations.english.md @@ -26,21 +26,21 @@ challengeType: 5 ```yml tests: - text: operation is a function. - testString: 'assert(typeof operation === ''function'', ''operation is a function.'');' + testString: 'assert(typeof operation === "function", "operation is a function.");' - text: 'operation("m_add",[[1,2],[3,4]],[[1,2],[3,4]]) should return [[2,4],[6,8]].' - testString: 'assert.deepEqual(operation(''m_add'', [[1, 2], [3, 4]], [[1, 2], [3, 4]]), [[2, 4], [6, 8]], ''operation("m_add",[[1,2],[3,4]],[[1,2],[3,4]]) should return [[2,4],[6,8]].'');' + testString: 'assert.deepEqual(operation("m_add", [[1, 2], [3, 4]], [[1, 2], [3, 4]]), [[2, 4], [6, 8]], "operation("m_add",[[1,2],[3,4]],[[1,2],[3,4]]) should return [[2,4],[6,8]].");' - text: 'operation("s_add",[[1,2],[3,4]],[[1,2],[3,4]]) should return [[3,4],[5,6]].' - testString: 'assert.deepEqual(operation(''s_add'', [[1, 2], [3, 4]], 2), [[3, 4], [5, 6]], ''operation("s_add",[[1,2],[3,4]],[[1,2],[3,4]]) should return [[3,4],[5,6]].'');' + testString: 'assert.deepEqual(operation("s_add", [[1, 2], [3, 4]], 2), [[3, 4], [5, 6]], "operation("s_add",[[1,2],[3,4]],[[1,2],[3,4]]) should return [[3,4],[5,6]].");' - text: 'operation("m_sub",[[1,2],[3,4]],[[1,2],[3,4]]) should return [[0,0],[0,0]].' - testString: 'assert.deepEqual(operation(''m_sub'', [[1, 2], [3, 4]], [[1, 2], [3, 4]]), [[0, 0], [0, 0]], ''operation("m_sub",[[1,2],[3,4]],[[1,2],[3,4]]) should return [[0,0],[0,0]].'');' + testString: 'assert.deepEqual(operation("m_sub", [[1, 2], [3, 4]], [[1, 2], [3, 4]]), [[0, 0], [0, 0]], "operation("m_sub",[[1,2],[3,4]],[[1,2],[3,4]]) should return [[0,0],[0,0]].");' - text: 'operation("m_mult",[[1,2],[3,4]],[[1,2],[3,4]]) should return [[1,4],[9,16]].' - testString: 'assert.deepEqual(operation(''m_mult'', [[1, 2], [3, 4]], [[1, 2], [3, 4]]), [[1, 4], [9, 16]], ''operation("m_mult",[[1,2],[3,4]],[[1,2],[3,4]]) should return [[1,4],[9,16]].'');' + testString: 'assert.deepEqual(operation("m_mult", [[1, 2], [3, 4]], [[1, 2], [3, 4]]), [[1, 4], [9, 16]], "operation("m_mult",[[1,2],[3,4]],[[1,2],[3,4]]) should return [[1,4],[9,16]].");' - text: 'operation("m_div",[[1,2],[3,4]],[[1,2],[3,4]]) should return [[1,1],[1,1]].' - testString: 'assert.deepEqual(operation(''m_div'', [[1, 2], [3, 4]], [[1, 2], [3, 4]]), [[1, 1], [1, 1]], ''operation("m_div",[[1,2],[3,4]],[[1,2],[3,4]]) should return [[1,1],[1,1]].'');' + testString: 'assert.deepEqual(operation("m_div", [[1, 2], [3, 4]], [[1, 2], [3, 4]]), [[1, 1], [1, 1]], "operation("m_div",[[1,2],[3,4]],[[1,2],[3,4]]) should return [[1,1],[1,1]].");' - text: 'operation("m_exp",[[1,2],[3,4]],[[1,2],[3,4]]) should return [[1,4],[27,256]].' - testString: 'assert.deepEqual(operation(''m_exp'', [[1, 2], [3, 4]], [[1, 2], [3, 4]]), [[1, 4], [27, 256]], ''operation("m_exp",[[1,2],[3,4]],[[1,2],[3,4]]) should return [[1,4],[27,256]].'');' + testString: 'assert.deepEqual(operation("m_exp", [[1, 2], [3, 4]], [[1, 2], [3, 4]]), [[1, 4], [27, 256]], "operation("m_exp",[[1,2],[3,4]],[[1,2],[3,4]]) should return [[1,4],[27,256]].");' - text: 'operation("m_add",[[1,2,3,4],[5,6,7,8]],[[9,10,11,12],[13,14,15,16]]) should return [[10,12,14,16],[18,20,22,24]].' - testString: 'assert.deepEqual(operation(''m_add'', [[1, 2, 3, 4], [5, 6, 7, 8]], [[9, 10, 11, 12], [13, 14, 15, 16]]), [[10, 12, 14, 16], [18, 20, 22, 24]], ''operation("m_add",[[1,2,3,4],[5,6,7,8]],[[9,10,11,12],[13,14,15,16]]) should return [[10,12,14,16],[18,20,22,24]].'');' + testString: 'assert.deepEqual(operation("m_add", [[1, 2, 3, 4], [5, 6, 7, 8]], [[9, 10, 11, 12], [13, 14, 15, 16]]), [[10, 12, 14, 16], [18, 20, 22, 24]], "operation("m_add",[[1,2,3,4],[5,6,7,8]],[[9,10,11,12],[13,14,15,16]]) should return [[10,12,14,16],[18,20,22,24]].");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/emirp-primes.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/emirp-primes.english.md index 2e0d5d14f3..1d3743fbf2 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/emirp-primes.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/emirp-primes.english.md @@ -21,15 +21,15 @@ challengeType: 5 ```yml tests: - text: emirps is a function. - testString: 'assert(typeof emirps === ''function'', ''emirps is a function.'');' + testString: 'assert(typeof emirps === "function", "emirps is a function.");' - text: 'emirps(20,true) should return [13,17,31,37,71,73,79,97,107,113,149,157,167,179,199,311,337,347,359,389]' - testString: 'assert.deepEqual(emirps(20, true), [13, 17, 31, 37, 71, 73, 79, 97, 107, 113, 149, 157, 167, 179, 199, 311, 337, 347, 359, 389], ''emirps(20,true) should return [13,17,31,37,71,73,79,97,107,113,149,157,167,179,199,311,337,347,359,389]'');' + testString: 'assert.deepEqual(emirps(20, true), [13, 17, 31, 37, 71, 73, 79, 97, 107, 113, 149, 157, 167, 179, 199, 311, 337, 347, 359, 389], "emirps(20,true) should return [13,17,31,37,71,73,79,97,107,113,149,157,167,179,199,311,337,347,359,389]");' - text: emirps(10000) should return 948349 - testString: 'assert.deepEqual(emirps(10000), 948349, ''emirps(10000) should return 948349'');' + testString: 'assert.deepEqual(emirps(10000), 948349, "emirps(10000) should return 948349");' - text: 'emirps([7700,8000],true) should return [7717,7757,7817,7841,7867,7879,7901,7927,7949,7951,7963]' - testString: 'assert.deepEqual(emirps([7700, 8000], true), [7717, 7757, 7817, 7841, 7867, 7879, 7901, 7927, 7949, 7951, 7963], ''emirps([7700,8000],true) should return [7717,7757,7817,7841,7867,7879,7901,7927,7949,7951,7963]'');' + testString: 'assert.deepEqual(emirps([7700, 8000], true), [7717, 7757, 7817, 7841, 7867, 7879, 7901, 7927, 7949, 7951, 7963], "emirps([7700,8000],true) should return [7717,7757,7817,7841,7867,7879,7901,7927,7949,7951,7963]");' - text: 'emirps([7700,8000],true) should return 11' - testString: 'assert.deepEqual(emirps([7700, 8000], false), 11, ''emirps([7700,8000],true) should return 11'');' + testString: 'assert.deepEqual(emirps([7700, 8000], false), 11, "emirps([7700,8000],true) should return 11");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/entropy.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/entropy.english.md index 5f8899408e..44e1603f05 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/entropy.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/entropy.english.md @@ -22,19 +22,19 @@ Task: ```yml tests: - text: entropy is a function. - testString: 'assert(typeof entropy === ''function'', ''entropy is a function.'');' + testString: 'assert(typeof entropy === "function", "entropy is a function.");' - text: entropy("0") should return 0 - testString: 'assert.equal(entropy(''0''), 0, ''entropy("0") should return 0'');' + testString: 'assert.equal(entropy("0"), 0, "entropy("0") should return 0");' - text: entropy("01") should return 1 - testString: 'assert.equal(entropy(''01''), 1, ''entropy("01") should return 1'');' + testString: 'assert.equal(entropy("01"), 1, "entropy("01") should return 1");' - text: entropy("0123") should return 2 - testString: 'assert.equal(entropy(''0123''), 2, ''entropy("0123") should return 2'');' + testString: 'assert.equal(entropy("0123"), 2, "entropy("0123") should return 2");' - text: entropy("01234567") should return 3 - testString: 'assert.equal(entropy(''01234567''), 3, ''entropy("01234567") should return 3'');' + testString: 'assert.equal(entropy("01234567"), 3, "entropy("01234567") should return 3");' - text: entropy("0123456789abcdef") should return 4 - testString: 'assert.equal(entropy(''0123456789abcdef''), 4, ''entropy("0123456789abcdef") should return 4'');' + testString: 'assert.equal(entropy("0123456789abcdef"), 4, "entropy("0123456789abcdef") should return 4");' - text: entropy("1223334444") should return 1.8464393446710154 - testString: 'assert.equal(entropy(''1223334444''), 1.8464393446710154, ''entropy("1223334444") should return 1.8464393446710154'');' + testString: 'assert.equal(entropy("1223334444"), 1.8464393446710154, "entropy("1223334444") should return 1.8464393446710154");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/equilibrium-index.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/equilibrium-index.english.md index 8bc515615b..e8b903fa77 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/equilibrium-index.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/equilibrium-index.english.md @@ -28,19 +28,19 @@ challengeType: 5 ```yml tests: - text: equilibrium is a function. - testString: 'assert(typeof equilibrium === ''function'', ''equilibrium is a function.'');' + testString: 'assert(typeof equilibrium === "function", "equilibrium is a function.");' - text: 'equilibrium([-7, 1, 5, 2, -4, 3, 0]) should return [3,6].' - testString: 'assert.deepEqual(equilibrium(tests[0]), ans[0], ''equilibrium([-7, 1, 5, 2, -4, 3, 0]) should return [3,6].'');' + testString: 'assert.deepEqual(equilibrium(tests[0]), ans[0], "equilibrium([-7, 1, 5, 2, -4, 3, 0]) should return [3,6].");' - text: 'equilibrium([2, 4, 6]) should return [].' - testString: 'assert.deepEqual(equilibrium(tests[1]), ans[1], ''equilibrium([2, 4, 6]) should return [].'');' + testString: 'assert.deepEqual(equilibrium(tests[1]), ans[1], "equilibrium([2, 4, 6]) should return [].");' - text: 'equilibrium([2, 9, 2]) should return [1].' - testString: 'assert.deepEqual(equilibrium(tests[2]), ans[2], ''equilibrium([2, 9, 2]) should return [1].'');' + testString: 'assert.deepEqual(equilibrium(tests[2]), ans[2], "equilibrium([2, 9, 2]) should return [1].");' - text: 'equilibrium([1, -1, 1, -1, 1, -1, 1]) should return [0,1,2,3,4,5,6].' - testString: 'assert.deepEqual(equilibrium(tests[3]), ans[3], ''equilibrium([1, -1, 1, -1, 1, -1, 1]) should return [0,1,2,3,4,5,6].'');' + testString: 'assert.deepEqual(equilibrium(tests[3]), ans[3], "equilibrium([1, -1, 1, -1, 1, -1, 1]) should return [0,1,2,3,4,5,6].");' - text: 'equilibrium([1]) should return [0].' - testString: 'assert.deepEqual(equilibrium(tests[4]), ans[4], ''equilibrium([1]) should return [0].'');' + testString: 'assert.deepEqual(equilibrium(tests[4]), ans[4], "equilibrium([1]) should return [0].");' - text: 'equilibrium([]) should return [].' - testString: 'assert.deepEqual(equilibrium(tests[5]), ans[5], ''equilibrium([]) should return [].'');' + testString: 'assert.deepEqual(equilibrium(tests[5]), ans[5], "equilibrium([]) should return [].");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/ethiopian-multiplication.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/ethiopian-multiplication.english.md index 9764a342af..b69bc1c206 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/ethiopian-multiplication.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/ethiopian-multiplication.english.md @@ -61,17 +61,17 @@ one to state if an integer is even. ```yml tests: - text: eth_mult is a function. - testString: 'assert(typeof eth_mult === ''function'', ''eth_mult is a function.'');' + testString: 'assert(typeof eth_mult === "function", "eth_mult is a function.");' - text: 'eth_mult(17,34) should return 578.' - testString: 'assert.equal(eth_mult(17, 34), 578, ''eth_mult(17,34) should return 578.'');' + testString: 'assert.equal(eth_mult(17, 34), 578, "eth_mult(17,34) should return 578.");' - text: 'eth_mult(23,46) should return 1058.' - testString: 'assert.equal(eth_mult(23, 46), 1058, ''eth_mult(23,46) should return 1058.'');' + testString: 'assert.equal(eth_mult(23, 46), 1058, "eth_mult(23,46) should return 1058.");' - text: 'eth_mult(12,27) should return 324.' - testString: 'assert.equal(eth_mult(12, 27), 324, ''eth_mult(12,27) should return 324.'');' + testString: 'assert.equal(eth_mult(12, 27), 324, "eth_mult(12,27) should return 324.");' - text: 'eth_mult(56,98) should return 5488.' - testString: 'assert.equal(eth_mult(56, 98), 5488, ''eth_mult(56,98) should return 5488.'');' + testString: 'assert.equal(eth_mult(56, 98), 5488, "eth_mult(56,98) should return 5488.");' - text: 'eth_mult(63,74) should return 4662.' - testString: 'assert.equal(eth_mult(63, 74), 4662, ''eth_mult(63,74) should return 4662.'');' + testString: 'assert.equal(eth_mult(63, 74), 4662, "eth_mult(63,74) should return 4662.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/euler-method.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/euler-method.english.md index 4dbc22142b..ada6069ce5 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/euler-method.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/euler-method.english.md @@ -36,15 +36,15 @@ Initial values: ```yml tests: - text: eulersMethod is a function. - testString: 'assert(typeof eulersMethod === ''function'', ''eulersMethod is a function.'');' + testString: 'assert(typeof eulersMethod === "function", "eulersMethod is a function.");' - text: 'eulersMethod(0, 100, 100, 10) should return a number.' - testString: 'assert(typeof eulersMethod(0, 100, 100, 10) === ''number'', ''eulersMethod(0, 100, 100, 10) should return a number.'');' + testString: 'assert(typeof eulersMethod(0, 100, 100, 10) === "number", "eulersMethod(0, 100, 100, 10) should return a number.");' - text: 'eulersMethod(0, 100, 100, 10) should return 20.0424631833732.' - testString: 'assert.equal(eulersMethod(0, 100, 100, 2), 20.0424631833732, ''eulersMethod(0, 100, 100, 10) should return 20.0424631833732.'');' + testString: 'assert.equal(eulersMethod(0, 100, 100, 2), 20.0424631833732, "eulersMethod(0, 100, 100, 10) should return 20.0424631833732.");' - text: 'eulersMethod(0, 100, 100, 10) should return 20.01449963666907.' - testString: 'assert.equal(eulersMethod(0, 100, 100, 5), 20.01449963666907, ''eulersMethod(0, 100, 100, 10) should return 20.01449963666907.'');' + testString: 'assert.equal(eulersMethod(0, 100, 100, 5), 20.01449963666907, "eulersMethod(0, 100, 100, 10) should return 20.01449963666907.");' - text: 'eulersMethod(0, 100, 100, 10) should return 20.000472392.' - testString: 'assert.equal(eulersMethod(0, 100, 100, 10), 20.000472392, ''eulersMethod(0, 100, 100, 10) should return 20.000472392.'');' + testString: 'assert.equal(eulersMethod(0, 100, 100, 10), 20.000472392, "eulersMethod(0, 100, 100, 10) should return 20.000472392.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/evaluate-binomial-coefficients.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/evaluate-binomial-coefficients.english.md index 26180b6d9b..2ea0225754 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/evaluate-binomial-coefficients.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/evaluate-binomial-coefficients.english.md @@ -21,17 +21,17 @@ $\binom{n}{k} = \frac{n!}{(n-k)!k!} = \frac{n(n-1)(n-2)\ldots(n-k+1)}{k(k-1)(k-2 ```yml tests: - text: binom is a function. - testString: 'assert(typeof binom === ''function'', ''binom is a function.'');' + testString: 'assert(typeof binom === "function", "binom is a function.");' - text: 'binom(5,3) should return 10.' - testString: 'assert.equal(binom(5, 3), 10, ''binom(5,3) should return 10.'');' + testString: 'assert.equal(binom(5, 3), 10, "binom(5,3) should return 10.");' - text: 'binom(7,2) should return 21.' - testString: 'assert.equal(binom(7, 2), 21, ''binom(7,2) should return 21.'');' + testString: 'assert.equal(binom(7, 2), 21, "binom(7,2) should return 21.");' - text: 'binom(10,4) should return 210.' - testString: 'assert.equal(binom(10, 4), 210, ''binom(10,4) should return 210.'');' + testString: 'assert.equal(binom(10, 4), 210, "binom(10,4) should return 210.");' - text: 'binom(6,1) should return 6.' - testString: 'assert.equal(binom(6, 1), 6, ''binom(6,1) should return 6.'');' + testString: 'assert.equal(binom(6, 1), 6, "binom(6,1) should return 6.");' - text: 'binom(12,8) should return 495.' - testString: 'assert.equal(binom(12, 8), 495, ''binom(12,8) should return 495.'');' + testString: 'assert.equal(binom(12, 8), 495, "binom(12,8) should return 495.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/execute-a-markov-algorithm.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/execute-a-markov-algorithm.english.md index f4186e13f8..69d47cf83c 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/execute-a-markov-algorithm.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/execute-a-markov-algorithm.english.md @@ -84,7 +84,7 @@ Next phase of applying1@1 -> x,@y ++ -> + Termination cleanup for addition_1 -> 1 1+_ -> 1 -_+_ -> +_+_ ->

Sample text of:

_1111*11111_

@@ -124,17 +124,17 @@ state C, symbol 1 => write 1, move left, halt0C1 -> H01 ```yml tests: - text: markov is a function. - testString: 'assert(typeof markov === ''function'', ''markov is a function.'');' + testString: 'assert(typeof markov === "function", "markov is a function.");' - text: 'markov(["A -> apple","B -> bag","S -> shop","T -> the","the shop -> my brother","a never used -> .terminating rule"],"I bought a B of As from T S.") should return "I bought a bag of apples from my brother.".' - testString: 'assert.deepEqual(markov(rules[0],tests[0]),outputs[0],''markov(["A -> apple","B -> bag","S -> shop","T -> the","the shop -> my brother","a never used -> .terminating rule"],"I bought a B of As from T S.") should return "I bought a bag of apples from my brother.".'');' + testString: 'assert.deepEqual(markov(rules[0],tests[0]),outputs[0],"markov(["A -> apple","B -> bag","S -> shop","T -> the","the shop -> my brother","a never used -> .terminating rule"],"I bought a B of As from T S.") should return "I bought a bag of apples from my brother.".");' - text: 'markov(["A -> apple","B -> bag","S -> .shop","T -> the","the shop -> my brother","a never used -> .terminating rule"],"I bought a B of As from T S.") should return "I bought a bag of apples from T shop.".' - testString: 'assert.deepEqual(markov(rules[1],tests[1]),outputs[1],''markov(["A -> apple","B -> bag","S -> .shop","T -> the","the shop -> my brother","a never used -> .terminating rule"],"I bought a B of As from T S.") should return "I bought a bag of apples from T shop.".'');' + testString: 'assert.deepEqual(markov(rules[1],tests[1]),outputs[1],"markov(["A -> apple","B -> bag","S -> .shop","T -> the","the shop -> my brother","a never used -> .terminating rule"],"I bought a B of As from T S.") should return "I bought a bag of apples from T shop.".");' - text: 'markov(["A -> apple","WWWW -> with","Bgage -> ->.*","B -> bag","->.* -> money","W -> WW","S -> .shop","T -> the","the shop -> my brother","a never used -> .terminating rule"],"I bought a B of As W my Bgage from T S.") should return "I bought a bag of apples with my money from T shop.".' - testString: 'assert.deepEqual(markov(rules[2],tests[2]),outputs[2],''markov(["A -> apple","WWWW -> with","Bgage -> ->.*","B -> bag","->.* -> money","W -> WW","S -> .shop","T -> the","the shop -> my brother","a never used -> .terminating rule"],"I bought a B of As W my Bgage from T S.") should return "I bought a bag of apples with my money from T shop.".'');' + testString: 'assert.deepEqual(markov(rules[2],tests[2]),outputs[2],"markov(["A -> apple","WWWW -> with","Bgage -> ->.*","B -> bag","->.* -> money","W -> WW","S -> .shop","T -> the","the shop -> my brother","a never used -> .terminating rule"],"I bought a B of As W my Bgage from T S.") should return "I bought a bag of apples with my money from T shop.".");' - text: 'markov(["_+1 -> _1+","1+1 -> 11+","1! -> !1",",! -> !+","_! -> _","1*1 -> x,@y","1x -> xX","X, -> 1,1","X1 -> 1X","_x -> _X",",x -> ,X","y1 -> 1y","y_ -> _","1@1 -> x,@y","1@_ -> @_",",@_ -> !_","++ -> +","_1 -> 1","1+_ -> 1","_+_ -> "],"_1111*11111_") should return "11111111111111111111".' - testString: 'assert.deepEqual(markov(rules[3],tests[3]),outputs[3],''markov(["_+1 -> _1+","1+1 -> 11+","1! -> !1",",! -> !+","_! -> _","1*1 -> x,@y","1x -> xX","X, -> 1,1","X1 -> 1X","_x -> _X",",x -> ,X","y1 -> 1y","y_ -> _","1@1 -> x,@y","1@_ -> @_",",@_ -> !_","++ -> +","_1 -> 1","1+_ -> 1","_+_ -> "],"_1111*11111_") should return "11111111111111111111".'');' + testString: 'assert.deepEqual(markov(rules[3],tests[3]),outputs[3],"markov(["_+1 -> _1+","1+1 -> 11+","1! -> !1",",! -> !+","_! -> _","1*1 -> x,@y","1x -> xX","X, -> 1,1","X1 -> 1X","_x -> _X",",x -> ,X","y1 -> 1y","y_ -> _","1@1 -> x,@y","1@_ -> @_",",@_ -> !_","++ -> +","_1 -> 1","1+_ -> 1","_+_ -> "],"_1111*11111_") should return "11111111111111111111".");' - text: 'markov(["A0 -> 1B","0A1 -> C01","1A1 -> C11","0B0 -> A01","1B0 -> A11","B1 -> 1B","0C0 -> B01","1C0 -> B11","0C1 -> H01","1C1 -> H11"],"") should return "00011H1111000".' - testString: 'assert.deepEqual(markov(rules[4],tests[4]),outputs[4],''markov(["A0 -> 1B","0A1 -> C01","1A1 -> C11","0B0 -> A01","1B0 -> A11","B1 -> 1B","0C0 -> B01","1C0 -> B11","0C1 -> H01","1C1 -> H11"],"") should return "00011H1111000".'');' + testString: 'assert.deepEqual(markov(rules[4],tests[4]),outputs[4],"markov(["A0 -> 1B","0A1 -> C01","1A1 -> C11","0B0 -> A01","1B0 -> A11","B1 -> 1B","0C0 -> B01","1C0 -> B11","0C1 -> H01","1C1 -> H11"],"") should return "00011H1111000".");' ``` @@ -167,7 +167,7 @@ function markov(rules,test) { let origTest = test; let captures = []; - + rules.forEach(function(rule){ let m = pattern.exec(rule); for (let j = 0; j < m.length; j++) 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 a56b54e300..93c4ea0b7b 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 @@ -43,15 +43,15 @@ challengeType: 5 ```yml tests: - text: brain(bye) should retuen a string - testString: 'assert(typeof brain(bye) === ''string'', ''brain(bye) should return a string'');' + testString: 'assert(typeof brain(bye) === "string", "brain(bye) should return a string");' - text: 'brain("++++++[>++++++++++<-]>+++++.")++++++++++<-]>+++++."),"A", ''brain("++++++[>++++++++++<-]>+++++.")++++++++++<-]>+++++."),"A", "brain("++++++[>++++++++++<-]>+++++.")brain(bye)
should return Goodbye, World!\\r\\n' - testString: 'assert.equal(brain(bye), ''Goodbye, World!\r\n'', ''brain(bye) should return Goodbye, World!\\r\\n'');' + testString: 'assert.equal(brain(bye), "Goodbye, World!\r\n", "brain(bye) should return Goodbye, World!\\r\\n");' - text: brain(hello) should return Hello World!\\n' - testString: 'assert.equal(brain(hello), "Hello World!\n", ''brain(hello) should return Hello World!\\n'');' + testString: 'assert.equal(brain(hello), "Hello World!\n", "brain(hello) should return Hello World!\\n");' - text: 'brain(fib) should return 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89' - testString: 'assert.equal(brain(fib), "1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89", ''brain(fib) should return 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89'');' + testString: 'assert.equal(brain(fib), "1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89", "brain(fib) should return 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/extensible-prime-generator.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/extensible-prime-generator.english.md index a5ca6ab20a..df2f4b4bf9 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/extensible-prime-generator.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/extensible-prime-generator.english.md @@ -20,15 +20,15 @@ challengeType: 5 ```yml tests: - text: primeGenerator is a function. - testString: 'assert(typeof primeGenerator === ''function'', ''primeGenerator is a function.'');' + testString: 'assert(typeof primeGenerator === "function", "primeGenerator is a function.");' - text: primeGenerator is a function. - testString: 'assert.deepEqual(primeGenerator(20, true), [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71], ''primeGenerator is a function.'');' + testString: 'assert.deepEqual(primeGenerator(20, true), [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71], "primeGenerator is a function.");' - text: primeGenerator is a function. - testString: 'assert.deepEqual(primeGenerator([100, 150], true), [101, 103, 107, 109, 113, 127, 131, 137, 139, 149], ''primeGenerator is a function.'');' + testString: 'assert.deepEqual(primeGenerator([100, 150], true), [101, 103, 107, 109, 113, 127, 131, 137, 139, 149], "primeGenerator is a function.");' - text: primeGenerator is a function. - testString: 'assert.equal(primeGenerator([7700, 8000], false), 30, ''primeGenerator is a function.'');' + testString: 'assert.equal(primeGenerator([7700, 8000], false), 30, "primeGenerator is a function.");' - text: primeGenerator is a function. - testString: 'assert.equal(primeGenerator(10000, false), 104729, ''primeGenerator is a function.'');' + testString: 'assert.equal(primeGenerator(10000, false), 104729, "primeGenerator is a function.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/factorial.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/factorial.english.md index e58b3baaf2..9bce51d883 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/factorial.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/factorial.english.md @@ -14,8 +14,8 @@ For example : 3! = 3*2*1 = 6 4! = 4*3*2*1 = 24

-

Note : -0! = 1 +

Note : +0! = 1

@@ -30,9 +30,9 @@ For example : ```yml tests: - text: factorial is a function. - testString: 'assert(typeof factorial === ''function'', ''factorial is a function.'');' + testString: 'assert(typeof factorial === "function", "factorial is a function.");' - text: factorial(2) should return a number. - testString: 'assert(typeof factorial(2) === ''number'', ''factorial(2) should return a number.'');' + testString: 'assert(typeof factorial(2) === "number", "factorial(2) should return a number.");' - text: factorial(3) should return 6.") testString: 'assert.equal(factorial(3),results[0],"factorial(3) should return 6.");' - text: factorial(3) should return 120.") diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/factors-of-a-mersenne-number.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/factors-of-a-mersenne-number.english.md index 546718fae2..e371bb3ffd 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/factors-of-a-mersenne-number.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/factors-of-a-mersenne-number.english.md @@ -50,15 +50,15 @@ Related tasks: ```yml tests: - text: check_mersenne is a function. - testString: 'assert(typeof check_mersenne === ''function'', ''check_mersenne is a function.'');' + testString: 'assert(typeof check_mersenne === "function", "check_mersenne is a function.");' - text: check_mersenne(3) should return a string. - testString: 'assert(typeof check_mersenne(3) == ''string'', ''check_mersenne(3) should return a string.'');' + testString: 'assert(typeof check_mersenne(3) == "string", "check_mersenne(3) should return a string.");' - text: check_mersenne(3) should return "M3 = 2^3-1 is prime". - testString: 'assert.equal(check_mersenne(3),"M3 = 2^3-1 is prime",''check_mersenne(3) should return "M3 = 2^3-1 is prime".'');' + testString: 'assert.equal(check_mersenne(3),"M3 = 2^3-1 is prime","check_mersenne(3) should return "M3 = 2^3-1 is prime".");' - text: check_mersenne(23) should return "M23 = 2^23-1 is composite with factor 47". - testString: 'assert.equal(check_mersenne(23),"M23 = 2^23-1 is composite with factor 47",''check_mersenne(23) should return "M23 = 2^23-1 is composite with factor 47".'');' + testString: 'assert.equal(check_mersenne(23),"M23 = 2^23-1 is composite with factor 47","check_mersenne(23) should return "M23 = 2^23-1 is composite with factor 47".");' - text: check_mersenne(929) should return "M929 = 2^929-1 is composite with factor 13007 - testString: 'assert.equal(check_mersenne(929),"M929 = 2^929-1 is composite with factor 13007",''check_mersenne(929) should return "M929 = 2^929-1 is composite with factor 13007'');' + testString: 'assert.equal(check_mersenne(929),"M929 = 2^929-1 is composite with factor 13007","check_mersenne(929) should return "M929 = 2^929-1 is composite with factor 13007");' ``` @@ -86,7 +86,7 @@ function check_mersenne (p) { ```js -function check_mersenne(p){ +function check_mersenne(p){ function isPrime(value){ for (let i=2; i < value; i++){ if (value % i == 0){ @@ -97,7 +97,7 @@ function check_mersenne(p){ } } } - + function trial_factor(base, exp, mod){ let square, bits; square = 1; @@ -107,7 +107,7 @@ function check_mersenne(p){ } return (square == 1); } - + function mersenne_factor(p){ let limit, k, q; limit = Math.sqrt(Math.pow(2,p) - 1); diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/factors-of-an-integer.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/factors-of-an-integer.english.md index 8ba5f56fa1..03b40b02ef 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/factors-of-an-integer.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/factors-of-an-integer.english.md @@ -21,13 +21,13 @@ challengeType: 5 ```yml tests: - text: factors is a function. - testString: 'assert(typeof factors === ''function'', ''factors is a function.'');' + testString: 'assert(typeof factors === "function", "factors is a function.");' - text: 'factors(45) should return [1,3,5,9,15,45].' - testString: 'assert.deepEqual(factors(45), ans[0], ''factors(45) should return [1,3,5,9,15,45].'');' + testString: 'assert.deepEqual(factors(45), ans[0], "factors(45) should return [1,3,5,9,15,45].");' - text: 'factors(53) should return [1,53].' - testString: 'assert.deepEqual(factors(53), ans[1], ''factors(53) should return [1,53].'');' + testString: 'assert.deepEqual(factors(53), ans[1], "factors(53) should return [1,53].");' - text: 'factors(64) should return [1,2,4,8,16,32,64].' - testString: 'assert.deepEqual(factors(64), ans[2], ''factors(64) should return [1,2,4,8,16,32,64].'');' + testString: 'assert.deepEqual(factors(64), ans[2], "factors(64) should return [1,2,4,8,16,32,64].");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/farey-sequence.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/farey-sequence.english.md index dcbebed310..b1a7a6d9bb 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/farey-sequence.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/farey-sequence.english.md @@ -32,15 +32,15 @@ challengeType: 5 ```yml tests: - text: farey is a function. - testString: 'assert(typeof farey === ''function'', ''farey is a function.'');' + testString: 'assert(typeof farey === "function", "farey is a function.");' - text: farey(3) should return an array - testString: 'assert(Array.isArray(farey(3)), ''farey(3) should return an array'');' + testString: 'assert(Array.isArray(farey(3)), "farey(3) should return an array");' - text: 'farey(3) should return ["1/3","1/2","2/3"]' - testString: 'assert.deepEqual(farey(3), ["1/3","1/2","2/3"], ''farey(3) should return ["1/3","1/2","2/3"]'');' + testString: 'assert.deepEqual(farey(3), ["1/3","1/2","2/3"], "farey(3) should return ["1/3","1/2","2/3"]");' - text: 'farey(4) should return ["1/4","1/3","1/2","2/4","2/3","3/4"]' - testString: 'assert.deepEqual(farey(4), ["1/4","1/3","1/2","2/4","2/3","3/4"], ''farey(4) should return ["1/4","1/3","1/2","2/4","2/3","3/4"]'');' + testString: 'assert.deepEqual(farey(4), ["1/4","1/3","1/2","2/4","2/3","3/4"], "farey(4) should return ["1/4","1/3","1/2","2/4","2/3","3/4"]");' - text: 'farey(5) should return ["1/5","1/4","1/3","2/5","1/2","2/4","3/5","2/3","3/4","4/5"]' - testString: 'assert.deepEqual(farey(5), ["1/5","1/4","1/3","2/5","1/2","2/4","3/5","2/3","3/4","4/5"], ''farey(5) should return ["1/5","1/4","1/3","2/5","1/2","2/4","3/5","2/3","3/4","4/5"]'');' + testString: 'assert.deepEqual(farey(5), ["1/5","1/4","1/3","2/5","1/2","2/4","3/5","2/3","3/4","4/5"], "farey(5) should return ["1/5","1/4","1/3","2/5","1/2","2/4","3/5","2/3","3/4","4/5"]");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/fibonacci-n-step-number-sequences.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/fibonacci-n-step-number-sequences.english.md index 3bfbf31c28..fbbe1f962d 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/fibonacci-n-step-number-sequences.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/fibonacci-n-step-number-sequences.english.md @@ -48,21 +48,21 @@ For general $n>2$ we have the Fibonacci $n$-step sequence - $F_k^n$; with initia ```yml tests: - text: fib_luc is a function. - testString: 'assert(typeof fib_luc === ''function'', ''fib_luc is a function.'');' + testString: 'assert(typeof fib_luc === "function", "fib_luc is a function.");' - text: 'fib_luc(2,10,"f") should return [1,1,2,3,5,8,13,21,34,55].' - testString: 'assert.deepEqual(fib_luc(2,10,"f"),ans[0],''fib_luc(2,10,"f") should return [1,1,2,3,5,8,13,21,34,55].'');' + testString: 'assert.deepEqual(fib_luc(2,10,"f"),ans[0],"fib_luc(2,10,"f") should return [1,1,2,3,5,8,13,21,34,55].");' - text: 'fib_luc(3,15,"f") should return [1,1,2,4,7,13,24,44,81,149,274,504,927,1705,3136].' - testString: 'assert.deepEqual(fib_luc(3,15,"f"),ans[1],''fib_luc(3,15,"f") should return [1,1,2,4,7,13,24,44,81,149,274,504,927,1705,3136].'');' + testString: 'assert.deepEqual(fib_luc(3,15,"f"),ans[1],"fib_luc(3,15,"f") should return [1,1,2,4,7,13,24,44,81,149,274,504,927,1705,3136].");' - text: 'fib_luc(4,15,"f") should return [1,1,2,4,8,15,29,56,108,208,401,773,1490,2872,5536].' - testString: 'assert.deepEqual(fib_luc(4,15,"f"),ans[2],''fib_luc(4,15,"f") should return [1,1,2,4,8,15,29,56,108,208,401,773,1490,2872,5536].'');' + testString: 'assert.deepEqual(fib_luc(4,15,"f"),ans[2],"fib_luc(4,15,"f") should return [1,1,2,4,8,15,29,56,108,208,401,773,1490,2872,5536].");' - text: 'fib_luc(2,10,"l") should return [ 2, 1, 3, 4, 7, 11, 18, 29, 47, 76].' - testString: 'assert.deepEqual(fib_luc(2,10,"l"),ans[3],''fib_luc(2,10,"l") should return [ 2, 1, 3, 4, 7, 11, 18, 29, 47, 76].'');' + testString: 'assert.deepEqual(fib_luc(2,10,"l"),ans[3],"fib_luc(2,10,"l") should return [ 2, 1, 3, 4, 7, 11, 18, 29, 47, 76].");' - text: 'fib_luc(3,15,"l") should return [ 2, 1, 3, 6, 10, 19, 35, 64, 118, 217, 399, 734, 1350, 2483, 4567 ].' - testString: 'assert.deepEqual(fib_luc(3,15,"l"),ans[4],''fib_luc(3,15,"l") should return [ 2, 1, 3, 6, 10, 19, 35, 64, 118, 217, 399, 734, 1350, 2483, 4567 ].'');' + testString: 'assert.deepEqual(fib_luc(3,15,"l"),ans[4],"fib_luc(3,15,"l") should return [ 2, 1, 3, 6, 10, 19, 35, 64, 118, 217, 399, 734, 1350, 2483, 4567 ].");' - text: 'fib_luc(4,15,"l") should return [ 2, 1, 3, 6, 12, 22, 43, 83, 160, 308, 594, 1145, 2207, 4254, 8200 ].' - testString: 'assert.deepEqual(fib_luc(4,15,"l"),ans[5],''fib_luc(4,15,"l") should return [ 2, 1, 3, 6, 12, 22, 43, 83, 160, 308, 594, 1145, 2207, 4254, 8200 ].'');' + testString: 'assert.deepEqual(fib_luc(4,15,"l"),ans[5],"fib_luc(4,15,"l") should return [ 2, 1, 3, 6, 12, 22, 43, 83, 160, 308, 594, 1145, 2207, 4254, 8200 ].");' - text: 'fib_luc(5,15,"l") should return [ 2, 1, 3, 6, 12, 24, 46, 91, 179, 352, 692, 1360, 2674, 5257, 10335 ].' - testString: 'assert.deepEqual(fib_luc(5,15,"l"),ans[6],''fib_luc(5,15,"l") should return [ 2, 1, 3, 6, 12, 24, 46, 91, 179, 352, 692, 1360, 2674, 5257, 10335 ].'');' + testString: 'assert.deepEqual(fib_luc(5,15,"l"),ans[6],"fib_luc(5,15,"l") should return [ 2, 1, 3, 6, 12, 24, 46, 91, 179, 352, 692, 1360, 2674, 5257, 10335 ].");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/fibonacci-sequence.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/fibonacci-sequence.english.md index 8f433b502b..46a3c7ba77 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/fibonacci-sequence.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/fibonacci-sequence.english.md @@ -25,9 +25,9 @@ challengeType: 5 ```yml tests: - text: fibonacci is a function. - testString: 'assert(typeof fibonacci === ''function'', ''fibonacci is a function.'');' + testString: 'assert(typeof fibonacci === "function", "fibonacci is a function.");' - text: fibonacci(2) should return a number. - testString: 'assert(typeof fibonacci(2) == ''number'', ''fibonacci(2) should return a number.'');' + testString: 'assert(typeof fibonacci(2) == "number", "fibonacci(2) should return a number.");' - text: fibonacci(3) should return 1.") testString: 'assert.equal(fibonacci(3),1,"fibonacci(3) should return 1.");' - text: fibonacci(5) should return 3.") diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/fibonacci-word.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/fibonacci-word.english.md index e55ad37af8..ef59df19e2 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/fibonacci-word.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/fibonacci-word.english.md @@ -23,11 +23,11 @@ challengeType: 5 ```yml tests: - text: fibWord is a function. - testString: 'assert(typeof fibWord === ''function'', ''fibWord is a function.'');' + testString: 'assert(typeof fibWord === "function", "fibWord is a function.");' - text: fibWord(5) should return an array. - testString: 'assert(Array.isArray(fibWord(5)),''fibWord(5) should return an array.'');' + testString: 'assert(Array.isArray(fibWord(5)),"fibWord(5) should return an array.");' - text: fibWord(5) should return '+JSON.stringify(ans)+'. - testString: 'assert.deepEqual(fibWord(5),ans,''fibWord(5) should return ''+JSON.stringify(ans)+''.'');' + testString: 'assert.deepEqual(fibWord(5),ans,"fibWord(5) should return "+JSON.stringify(ans)+".");' ``` @@ -66,16 +66,16 @@ console.info('after the test'); function fibWord(n) { function entropy(s) { //create an object containing each individual char - //and the amount of iterations per char + //and the amount of iterations per char function prob(s) { var h = Object.create(null); s.split('').forEach(function(c) { - h[c] && h[c]++ || (h[c] = 1); + h[c] && h[c]++ || (h[c] = 1); }); return h; } - s = s.toString(); //just in case + s = s.toString(); //just in case var e = 0, l = s.length, h = prob(s); for (var i in h ) { @@ -85,7 +85,7 @@ function fibWord(n) { return e; } var wOne = "1", wTwo = "0", wNth = [wOne, wTwo], w = "", o = []; - + for (var i = 0; i < n; i++) { if (i === 0 || i === 1) { w = wNth[i]; @@ -95,7 +95,7 @@ function fibWord(n) { } var l = w.length; var e = entropy(w); - + if (l <= 21) { o.push({ N: i + 1, @@ -110,7 +110,7 @@ function fibWord(n) { Entropy: e, Word: "..." }); - } + } } return o; } diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/fractran.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/fractran.english.md index fda6cbcfbe..faff507572 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/fractran.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/fractran.english.md @@ -26,19 +26,19 @@ challengeType: 3 ```yml tests: - text: fractran should be a function. - testString: 'assert(typeof fractran==''function'',''fractran should be a function.'');' - - text: 'fractran("''+tests[0]+''") should return an array.' - testString: 'assert(Array.isArray(fractran(tests[0])),''fractran("''+tests[0]+''") should return an array.'');' - - text: 'fractran("''+tests[0]+''") should return ''+JSON.stringify(results[0])+''.' - testString: 'assert.deepEqual(fractran(tests[0]),results[0],''fractran("''+tests[0]+''") should return ''+JSON.stringify(results[0])+''.'');' - - text: 'fractran("''+tests[1]+''") should return ''+JSON.stringify(results[1])+''.' - testString: 'assert.deepEqual(fractran(tests[1]),results[1],''fractran("''+tests[1]+''") should return ''+JSON.stringify(results[1])+''.'');' - - text: 'fractran("''+tests[2]+''") should return ''+JSON.stringify(results[2])+''.' - testString: 'assert.deepEqual(fractran(tests[2]),results[2],''fractran("''+tests[2]+''") should return ''+JSON.stringify(results[2])+''.'');' - - text: 'fractran("''+tests[3]+''") should return ''+JSON.stringify(results[3])+''.' - testString: 'assert.deepEqual(fractran(tests[3]),results[3],''fractran("''+tests[3]+''") should return ''+JSON.stringify(results[3])+''.'');' - - text: 'fractran("''+tests[4]+''") should return ''+JSON.stringify(results[4])+''.' - testString: 'assert.deepEqual(fractran(tests[4]),results[4],''fractran("''+tests[4]+''") should return ''+JSON.stringify(results[4])+''.'');' + testString: 'assert(typeof fractran=="function","fractran should be a function.");' + - text: 'fractran(""+tests[0]+"") should return an array.' + testString: 'assert(Array.isArray(fractran(tests[0])),"fractran(""+tests[0]+"") should return an array.");' + - text: 'fractran(""+tests[0]+"") should return "+JSON.stringify(results[0])+".' + testString: 'assert.deepEqual(fractran(tests[0]),results[0],"fractran(""+tests[0]+"") should return "+JSON.stringify(results[0])+".");' + - text: 'fractran(""+tests[1]+"") should return "+JSON.stringify(results[1])+".' + testString: 'assert.deepEqual(fractran(tests[1]),results[1],"fractran(""+tests[1]+"") should return "+JSON.stringify(results[1])+".");' + - text: 'fractran(""+tests[2]+"") should return "+JSON.stringify(results[2])+".' + testString: 'assert.deepEqual(fractran(tests[2]),results[2],"fractran(""+tests[2]+"") should return "+JSON.stringify(results[2])+".");' + - text: 'fractran(""+tests[3]+"") should return "+JSON.stringify(results[3])+".' + testString: 'assert.deepEqual(fractran(tests[3]),results[3],"fractran(""+tests[3]+"") should return "+JSON.stringify(results[3])+".");' + - text: 'fractran(""+tests[4]+"") should return "+JSON.stringify(results[4])+".' + testString: 'assert.deepEqual(fractran(tests[4]),results[4],"fractran(""+tests[4]+"") should return "+JSON.stringify(results[4])+".");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/gamma-function.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/gamma-function.english.md index 01148bbc0d..9d606637b3 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/gamma-function.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/gamma-function.english.md @@ -22,19 +22,19 @@ The Gamma function can be defined as: ```yml tests: - text: gamma should be a function. - testString: 'assert(typeof gamma==''function'',''gamma should be a function.'')' - - text: 'gamma(''+tests[0]+'') should return a number.' - testString: 'assert(typeof gamma(tests[0])==''number'',''gamma(''+tests[0]+'') should return a number.'')' - - text: 'gamma(''+tests[0]+'') should return ''+results[0]+''.' - testString: 'assert.equal(gamma(tests[0]),results[0],''gamma(''+tests[0]+'') should return ''+results[0]+''.'')' - - text: 'gamma(''+tests[1]+'') should return ''+results[1]+''.' - testString: 'assert.equal(gamma(tests[1]),results[1],''gamma(''+tests[1]+'') should return ''+results[1]+''.'')' - - text: 'gamma(''+tests[2]+'') should return ''+results[2]+''.' - testString: 'assert.equal(gamma(tests[2]),results[2],''gamma(''+tests[2]+'') should return ''+results[2]+''.'')' - - text: 'gamma(''+tests[3]+'') should return ''+results[3]+''.' - testString: 'assert.equal(gamma(tests[3]),results[3],''gamma(''+tests[3]+'') should return ''+results[3]+''.'')' - - text: 'gamma(''+tests[4]+'') should return ''+results[4]+''.' - testString: 'assert.equal(gamma(tests[4]),results[4],''gamma(''+tests[4]+'') should return ''+results[4]+''.'')' + testString: 'assert(typeof gamma=="function","gamma should be a function.")' + - text: 'gamma("+tests[0]+") should return a number.' + testString: 'assert(typeof gamma(tests[0])=="number","gamma("+tests[0]+") should return a number.")' + - text: 'gamma("+tests[0]+") should return "+results[0]+".' + testString: 'assert.equal(gamma(tests[0]),results[0],"gamma("+tests[0]+") should return "+results[0]+".")' + - text: 'gamma("+tests[1]+") should return "+results[1]+".' + testString: 'assert.equal(gamma(tests[1]),results[1],"gamma("+tests[1]+") should return "+results[1]+".")' + - text: 'gamma("+tests[2]+") should return "+results[2]+".' + testString: 'assert.equal(gamma(tests[2]),results[2],"gamma("+tests[2]+") should return "+results[2]+".")' + - text: 'gamma("+tests[3]+") should return "+results[3]+".' + testString: 'assert.equal(gamma(tests[3]),results[3],"gamma("+tests[3]+") should return "+results[3]+".")' + - text: 'gamma("+tests[4]+") should return "+results[4]+".' + testString: 'assert.equal(gamma(tests[4]),results[4],"gamma("+tests[4]+") should return "+results[4]+".")' ``` @@ -75,7 +75,7 @@ function gamma(x) { 771.32342877765313, -176.61502916214059, 12.507343278686905, -0.13857109526572012, 9.9843695780195716e-6, 1.5056327351493116e-7 ]; - + var g = 7; if (x < 0.5) { return Math.PI / (Math.sin(Math.PI * x) * gamma(1 - x)); @@ -87,7 +87,7 @@ function gamma(x) { for (var i = 1; i < p.length; i++) { a += p[i] / (x + i); } - + var result=Math.sqrt(2 * Math.PI) * Math.pow(t, x + 0.5) * Math.exp(-t) * a; return result; diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/gaussian-elimination.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/gaussian-elimination.english.md index e2291700a2..8af255622a 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/gaussian-elimination.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/gaussian-elimination.english.md @@ -19,20 +19,20 @@ Write a function to solve \(A.x = b\) using Gaussian elimination then backwards ```yml tests: - - text: '''gaussianElimination should be a function.''' - testString: 'assert(typeof gaussianElimination==''function'',''gaussianElimination should be a function.'');' - - text: '''gaussianElimination(''+JSON.stringify(tests[0][0])+'',''+JSON.stringify(tests[0][1])+'') should return an array.''' - testString: 'assert(Array.isArray(gaussianElimination(tests[0][0],tests[0][1])),''gaussianElimination(''+JSON.stringify(tests[0][0])+'',''+JSON.stringify(tests[0][1])+'') should return an array.'');' - - text: '''gaussianElimination(''+JSON.stringify(tests[0][0])+'',''+JSON.stringify(tests[0][1])+'') should return ''+JSON.stringify(results[0])+''.''' - testString: 'assert.deepEqual(gaussianElimination(tests[0][0],tests[0][1]),results[0],''gaussianElimination(''+JSON.stringify(tests[0][0])+'',''+JSON.stringify(tests[0][1])+'') should return ''+JSON.stringify(results[0])+''.'');' - - text: '''gaussianElimination(''+JSON.stringify(tests[1][0])+'',''+JSON.stringify(tests[1][1])+'') should return ''+JSON.stringify(results[1])+''.''' - testString: 'assert.deepEqual(gaussianElimination(tests[1][0],tests[1][1]),results[1],''gaussianElimination(''+JSON.stringify(tests[1][0])+'',''+JSON.stringify(tests[1][1])+'') should return ''+JSON.stringify(results[1])+''.'');' - - text: '''gaussianElimination(''+JSON.stringify(tests[2][0])+'',''+JSON.stringify(tests[2][1])+'') should return ''+JSON.stringify(results[2])+''.''' - testString: 'assert.deepEqual(gaussianElimination(tests[2][0],tests[2][1]),results[2],''gaussianElimination(''+JSON.stringify(tests[2][0])+'',''+JSON.stringify(tests[2][1])+'') should return ''+JSON.stringify(results[2])+''.'');' - - text: '''gaussianElimination(''+JSON.stringify(tests[3][0])+'',''+JSON.stringify(tests[3][1])+'') should return ''+JSON.stringify(results[3])+''.''' - testString: 'assert.deepEqual(gaussianElimination(tests[3][0],tests[3][1]),results[3],''gaussianElimination(''+JSON.stringify(tests[3][0])+'',''+JSON.stringify(tests[3][1])+'') should return ''+JSON.stringify(results[3])+''.'');' - - text: '''gaussianElimination(''+JSON.stringify(tests[4][0])+'',''+JSON.stringify(tests[4][1])+'') should return ''+JSON.stringify(results[4])+''.''' - testString: 'assert.deepEqual(gaussianElimination(tests[4][0],tests[4][1]),results[4],''gaussianElimination(''+JSON.stringify(tests[4][0])+'',''+JSON.stringify(tests[4][1])+'') should return ''+JSON.stringify(results[4])+''.'');' + - text: "'gaussianElimination should be a function."' + testString: 'assert(typeof gaussianElimination=="function","gaussianElimination should be a function.");' + - text: "'gaussianElimination("+JSON.stringify(tests[0][0])+","+JSON.stringify(tests[0][1])+") should return an array."' + testString: 'assert(Array.isArray(gaussianElimination(tests[0][0],tests[0][1])),"gaussianElimination("+JSON.stringify(tests[0][0])+","+JSON.stringify(tests[0][1])+") should return an array.");' + - text: "'gaussianElimination("+JSON.stringify(tests[0][0])+","+JSON.stringify(tests[0][1])+") should return "+JSON.stringify(results[0])+"."' + testString: 'assert.deepEqual(gaussianElimination(tests[0][0],tests[0][1]),results[0],"gaussianElimination("+JSON.stringify(tests[0][0])+","+JSON.stringify(tests[0][1])+") should return "+JSON.stringify(results[0])+".");' + - text: "'gaussianElimination("+JSON.stringify(tests[1][0])+","+JSON.stringify(tests[1][1])+") should return "+JSON.stringify(results[1])+"."' + testString: 'assert.deepEqual(gaussianElimination(tests[1][0],tests[1][1]),results[1],"gaussianElimination("+JSON.stringify(tests[1][0])+","+JSON.stringify(tests[1][1])+") should return "+JSON.stringify(results[1])+".");' + - text: "'gaussianElimination("+JSON.stringify(tests[2][0])+","+JSON.stringify(tests[2][1])+") should return "+JSON.stringify(results[2])+"."' + testString: 'assert.deepEqual(gaussianElimination(tests[2][0],tests[2][1]),results[2],"gaussianElimination("+JSON.stringify(tests[2][0])+","+JSON.stringify(tests[2][1])+") should return "+JSON.stringify(results[2])+".");' + - text: "'gaussianElimination("+JSON.stringify(tests[3][0])+","+JSON.stringify(tests[3][1])+") should return "+JSON.stringify(results[3])+"."' + testString: 'assert.deepEqual(gaussianElimination(tests[3][0],tests[3][1]),results[3],"gaussianElimination("+JSON.stringify(tests[3][0])+","+JSON.stringify(tests[3][1])+") should return "+JSON.stringify(results[3])+".");' + - text: "'gaussianElimination("+JSON.stringify(tests[4][0])+","+JSON.stringify(tests[4][1])+") should return "+JSON.stringify(results[4])+"."' + testString: 'assert.deepEqual(gaussianElimination(tests[4][0],tests[4][1]),results[4],"gaussianElimination("+JSON.stringify(tests[4][0])+","+JSON.stringify(tests[4][1])+") should return "+JSON.stringify(results[4])+".");' ``` @@ -76,7 +76,7 @@ function gaussianElimination(A, b) { var n = A.length var idx = new Array(n) // Output vector with row permutations from partial pivoting var vv = new Array(n) // Scaling information - + for (var i=0; igenFizzBuzz should be a function.''' - testString: 'assert(typeof genFizzBuzz==''function'',''genFizzBuzz should be a function.'');' - - text: '''genFizzBuzz(''+JSON.stringify(tests[0][0])+'',''+tests[0][1]+'') should return a type.''' - testString: 'assert(typeof genFizzBuzz(tests[0][0],tests[0][1])==''string'',''genFizzBuzz(''+JSON.stringify(tests[0][0])+'',''+tests[0][1]+'') should return a type.'');' - - text: '''genFizzBuzz(''+JSON.stringify(tests[0][0])+'',''+tests[0][1]+'') should return "''+results[0]+''".''' - testString: 'assert.equal(genFizzBuzz(tests[0][0],tests[0][1]),results[0],''genFizzBuzz(''+JSON.stringify(tests[0][0])+'',''+tests[0][1]+'') should return "''+results[0]+''".'');' - - text: '''genFizzBuzz(''+JSON.stringify(tests[1][0])+'',''+tests[1][1]+'') should return "''+results[1]+''".''' - testString: 'assert.equal(genFizzBuzz(tests[1][0],tests[1][1]),results[1],''genFizzBuzz(''+JSON.stringify(tests[1][0])+'',''+tests[1][1]+'') should return "''+results[1]+''".'');' - - text: '''genFizzBuzz(''+JSON.stringify(tests[2][0])+'',''+tests[2][1]+'') should return "''+results[2]+''".''' - testString: 'assert.equal(genFizzBuzz(tests[2][0],tests[2][1]),results[2],''genFizzBuzz(''+JSON.stringify(tests[2][0])+'',''+tests[2][1]+'') should return "''+results[2]+''".'');' - - text: '''genFizzBuzz(''+JSON.stringify(tests[3][0])+'',''+tests[3][1]+'') should return "''+results[3]+''".''' - testString: 'assert.equal(genFizzBuzz(tests[3][0],tests[3][1]),results[3],''genFizzBuzz(''+JSON.stringify(tests[3][0])+'',''+tests[3][1]+'') should return "''+results[3]+''".'');' - - text: '''genFizzBuzz(''+JSON.stringify(tests[4][0])+'',''+tests[4][1]+'') should return "''+results[4]+''".''' - testString: 'assert.equal(genFizzBuzz(tests[4][0],tests[4][1]),results[4],''genFizzBuzz(''+JSON.stringify(tests[4][0])+'',''+tests[4][1]+'') should return "''+results[4]+''".'');' - - text: '''genFizzBuzz(''+JSON.stringify(tests[5][0])+'',''+tests[5][1]+'') should return "''+results[5]+''".''' - testString: 'assert.equal(genFizzBuzz(tests[5][0],tests[5][1]),results[5],''genFizzBuzz(''+JSON.stringify(tests[5][0])+'',''+tests[5][1]+'') should return "''+results[5]+''".'');' - - text: '''genFizzBuzz(''+JSON.stringify(tests[6][0])+'',''+tests[6][1]+'') should return "''+results[6]+''".''' - testString: 'assert.equal(genFizzBuzz(tests[6][0],tests[6][1]),results[6],''genFizzBuzz(''+JSON.stringify(tests[6][0])+'',''+tests[6][1]+'') should return "''+results[6]+''".'');' + - text: "'genFizzBuzz should be a function."' + testString: 'assert(typeof genFizzBuzz=="function","genFizzBuzz should be a function.");' + - text: "'genFizzBuzz("+JSON.stringify(tests[0][0])+","+tests[0][1]+") should return a type."' + testString: 'assert(typeof genFizzBuzz(tests[0][0],tests[0][1])=="string","genFizzBuzz("+JSON.stringify(tests[0][0])+","+tests[0][1]+") should return a type.");' + - text: "'genFizzBuzz("+JSON.stringify(tests[0][0])+","+tests[0][1]+") should return ""+results[0]+""."' + testString: 'assert.equal(genFizzBuzz(tests[0][0],tests[0][1]),results[0],"genFizzBuzz("+JSON.stringify(tests[0][0])+","+tests[0][1]+") should return ""+results[0]+"".");' + - text: "'genFizzBuzz("+JSON.stringify(tests[1][0])+","+tests[1][1]+") should return ""+results[1]+""."' + testString: 'assert.equal(genFizzBuzz(tests[1][0],tests[1][1]),results[1],"genFizzBuzz("+JSON.stringify(tests[1][0])+","+tests[1][1]+") should return ""+results[1]+"".");' + - text: "'genFizzBuzz("+JSON.stringify(tests[2][0])+","+tests[2][1]+") should return ""+results[2]+""."' + testString: 'assert.equal(genFizzBuzz(tests[2][0],tests[2][1]),results[2],"genFizzBuzz("+JSON.stringify(tests[2][0])+","+tests[2][1]+") should return ""+results[2]+"".");' + - text: "'genFizzBuzz("+JSON.stringify(tests[3][0])+","+tests[3][1]+") should return ""+results[3]+""."' + testString: 'assert.equal(genFizzBuzz(tests[3][0],tests[3][1]),results[3],"genFizzBuzz("+JSON.stringify(tests[3][0])+","+tests[3][1]+") should return ""+results[3]+"".");' + - text: "'genFizzBuzz("+JSON.stringify(tests[4][0])+","+tests[4][1]+") should return ""+results[4]+""."' + testString: 'assert.equal(genFizzBuzz(tests[4][0],tests[4][1]),results[4],"genFizzBuzz("+JSON.stringify(tests[4][0])+","+tests[4][1]+") should return ""+results[4]+"".");' + - text: "'genFizzBuzz("+JSON.stringify(tests[5][0])+","+tests[5][1]+") should return ""+results[5]+""."' + testString: 'assert.equal(genFizzBuzz(tests[5][0],tests[5][1]),results[5],"genFizzBuzz("+JSON.stringify(tests[5][0])+","+tests[5][1]+") should return ""+results[5]+"".");' + - text: "'genFizzBuzz("+JSON.stringify(tests[6][0])+","+tests[6][1]+") should return ""+results[6]+""."' + testString: 'assert.equal(genFizzBuzz(tests[6][0],tests[6][1]),results[6],"genFizzBuzz("+JSON.stringify(tests[6][0])+","+tests[6][1]+") should return ""+results[6]+"".");' ``` @@ -77,13 +77,13 @@ console.info('after the test'); ```js function genFizzBuzz(rules, num) { - let res=''; + let res="; rules.forEach(function (e) { if(num % e[0] == 0) res+=e[1]; }) - if(res==''){ + if(res=="){ res=num.toString(); } diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/generate-lower-case-ascii-alphabet.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/generate-lower-case-ascii-alphabet.english.md index 1a5ce892ff..128a1c0772 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/generate-lower-case-ascii-alphabet.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/generate-lower-case-ascii-alphabet.english.md @@ -19,20 +19,20 @@ Write a function to generate an array of lower case ASCII characters, for a give ```yml tests: - - text: '''lascii should be a function.''' - testString: 'assert(typeof lascii==''function'',''lascii should be a function.'');' - - text: '''lascii("a","d") should return an array.''' - testString: 'assert(Array.isArray(lascii(''a'',''d'')),''lascii("a","d") should return an array.'');' - - text: '"lascii(''a'',''d'') should return [ ''a'', ''b'', ''c'', ''d'' ]."' - testString: 'assert.deepEqual(lascii("a","d"),results[0],"lascii(''a'',''d'') should return [ ''a'', ''b'', ''c'', ''d'' ].");' - - text: '"lascii(''c'',''i'') should return [ ''c'', ''d'', ''e'', ''f'', ''g'', ''h'', ''i'' ]."' - testString: 'assert.deepEqual(lascii("c","i"),results[1],"lascii(''c'',''i'') should return [ ''c'', ''d'', ''e'', ''f'', ''g'', ''h'', ''i'' ].");' - - text: '"lascii(''m'',''q'') should return [ ''m'', ''n'', ''o'', ''p'', ''q'' ]."' - testString: 'assert.deepEqual(lascii("m","q"),results[2],"lascii(''m'',''q'') should return [ ''m'', ''n'', ''o'', ''p'', ''q'' ].");' - - text: '"lascii(''k'',''n'') should return [ ''k'', ''l'', ''m'', ''n'' ].")' - testString: 'assert.deepEqual(lascii("k","n"),results[3],"lascii(''k'',''n'') should return [ ''k'', ''l'', ''m'', ''n'' ].");' - - text: '"lascii(''t'',''z'') should return [ ''t'', ''u'', ''v'', ''w'', ''x'', ''y'', ''z'' ]."' - testString: 'assert.deepEqual(lascii("t","z"),results[4],"lascii(''t'',''z'') should return [ ''t'', ''u'', ''v'', ''w'', ''x'', ''y'', ''z'' ].");' + - text: "'lascii should be a function."' + testString: 'assert(typeof lascii=="function","lascii should be a function.");' + - text: "'lascii("a","d") should return an array."' + testString: 'assert(Array.isArray(lascii("a","d")),"lascii("a","d") should return an array.");' + - text: '"lascii("a","d") should return [ "a", "b", "c", "d" ]."' + testString: 'assert.deepEqual(lascii("a","d"),results[0],"lascii("a","d") should return [ "a", "b", "c", "d" ].");' + - text: '"lascii("c","i") should return [ "c", "d", "e", "f", "g", "h", "i" ]."' + testString: 'assert.deepEqual(lascii("c","i"),results[1],"lascii("c","i") should return [ "c", "d", "e", "f", "g", "h", "i" ].");' + - text: '"lascii("m","q") should return [ "m", "n", "o", "p", "q" ]."' + testString: 'assert.deepEqual(lascii("m","q"),results[2],"lascii("m","q") should return [ "m", "n", "o", "p", "q" ].");' + - text: '"lascii("k","n") should return [ "k", "l", "m", "n" ].")' + testString: 'assert.deepEqual(lascii("k","n"),results[3],"lascii("k","n") should return [ "k", "l", "m", "n" ].");' + - text: '"lascii("t","z") should return [ "t", "u", "v", "w", "x", "y", "z" ]."' + testString: 'assert.deepEqual(lascii("t","z"),results[4],"lascii("t","z") should return [ "t", "u", "v", "w", "x", "y", "z" ].");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/generatorexponential.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/generatorexponential.english.md index 76ee44cec1..11b10c2152 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/generatorexponential.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/generatorexponential.english.md @@ -24,20 +24,20 @@ For example for \(n=7\), the function should return 81 as the sequence would be ```yml tests: - - text: '''exponentialGenerator should be a function.''' - testString: 'assert(typeof exponentialGenerator==''function'',''exponentialGenerator should be a function.'');' - - text: '''exponentialGenerator() should return a number.''' - testString: 'assert(typeof exponentialGenerator(10)==''number'',''exponentialGenerator() should return a number.'');' - - text: '''exponentialGenerator(10) should return 144.''' - testString: 'assert.equal(exponentialGenerator(10),144,''exponentialGenerator(10) should return 144.'');' - - text: '''exponentialGenerator(12) should return 196.''' - testString: 'assert.equal(exponentialGenerator(12),196,''exponentialGenerator(12) should return 196.'');' - - text: '''exponentialGenerator(14) should return 256.''' - testString: 'assert.equal(exponentialGenerator(14),256,''exponentialGenerator(14) should return 256.'');' - - text: '''exponentialGenerator(20) should return 484.''' - testString: 'assert.equal(exponentialGenerator(20),484,''exponentialGenerator(20) should return 484.'');' - - text: '''exponentialGenerator(25) should return 784.''' - testString: 'assert.equal(exponentialGenerator(25),784,''exponentialGenerator(25) should return 784.'');' + - text: "'exponentialGenerator should be a function."' + testString: 'assert(typeof exponentialGenerator=="function","exponentialGenerator should be a function.");' + - text: "'exponentialGenerator() should return a number."' + testString: 'assert(typeof exponentialGenerator(10)=="number","exponentialGenerator() should return a number.");' + - text: "'exponentialGenerator(10) should return 144."' + testString: 'assert.equal(exponentialGenerator(10),144,"exponentialGenerator(10) should return 144.");' + - text: "'exponentialGenerator(12) should return 196."' + testString: 'assert.equal(exponentialGenerator(12),196,"exponentialGenerator(12) should return 196.");' + - text: "'exponentialGenerator(14) should return 256."' + testString: 'assert.equal(exponentialGenerator(14),256,"exponentialGenerator(14) should return 256.");' + - text: "'exponentialGenerator(20) should return 484."' + testString: 'assert.equal(exponentialGenerator(20),484,"exponentialGenerator(20) should return 484.");' + - text: "'exponentialGenerator(25) should return 784."' + testString: 'assert.equal(exponentialGenerator(25),784,"exponentialGenerator(25) should return 784.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/gray-code.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/gray-code.english.md index 506bd2663b..75e9ee6cb3 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/gray-code.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/gray-code.english.md @@ -7,12 +7,12 @@ challengeType: 5 ## Description
Gray code is a form of binary encoding where transitions between consecutive numbers differ by only one bit. -This is a useful encoding for reducing hardware data hazards with values that change rapidly and/or connect to slower hardware as inputs. -It is also useful for generating inputs for Karnaugh maps in order from left to right or top to bottom. -Create a function to encode a number to and decode a number from Gray code. The function should will have 2 parameters. +This is a useful encoding for reducing hardware data hazards with values that change rapidly and/or connect to slower hardware as inputs. +It is also useful for generating inputs for Karnaugh maps in order from left to right or top to bottom. +Create a function to encode a number to and decode a number from Gray code. The function should will have 2 parameters. The first would be a boolean. The function should encode for true and decode for false. The second parameter would be the number to be encoded/decoded. Display the normal binary representations, Gray code representations, and decoded Gray code values for all 5-bit binary numbers (0-31 inclusive, leading 0's not necessary). -There are many possible Gray codes. The following encodes what is called "binary reflected Gray code."
Encoding (MSB is bit 0, b is binary, g is Gray code): +There are many possible Gray codes. The following encodes what is called "binary reflected Gray code."
Encoding (MSB is bit 0, b is binary, g is Gray code):
if b[i-1] = 1
g[i] = not b[i]
else
g[i] = b[i]
Or:
g = b xor (b logically right shifted 1 time)
Decoding (MSB is bit 0, b is binary, g is Gray code):
b[0] = g[0]
for other bits:
b[i] = g[i] xor b[i-1]
@@ -28,22 +28,22 @@ There are many possible Gray codes. The following encodes what is called "binary ```yml tests: - - text: '''gray should be a function.''' - testString: 'assert(typeof gray==''function'',''gray should be a function.'');' - - text: '''gray(true,177) should return a number.''' - testString: 'assert(typeof gray(true,177)==''number'',''gray(true,177) should return a number.'');' - - text: '''gray(true,177) should return 233.''' - testString: 'assert.equal(gray(true,177),233,''gray(true,177) should return 233.'');' - - text: '''gray(true,425) should return 381.''' - testString: 'assert.equal(gray(true,425),381,''gray(true,425) should return 381.'');' - - text: '''gray(true,870) should return 725.''' - testString: 'assert.equal(gray(true,870),725,''gray(true,870) should return 725.'');' - - text: '''gray(false,233) should return 177.''' - testString: 'assert.equal(gray(false,233),177,''gray(false,233) should return 177.'');' - - text: '''gray(false,381) should return 425.''' - testString: 'assert.equal(gray(false,381),425,''gray(false,381) should return 425.'');' - - text: '''gray(false,725) should return 870.''' - testString: 'assert.equal(gray(false,725),870,''gray(false,725) should return 870.'');' + - text: "'gray should be a function."' + testString: 'assert(typeof gray=="function","gray should be a function.");' + - text: "'gray(true,177) should return a number."' + testString: 'assert(typeof gray(true,177)=="number","gray(true,177) should return a number.");' + - text: "'gray(true,177) should return 233."' + testString: 'assert.equal(gray(true,177),233,"gray(true,177) should return 233.");' + - text: "'gray(true,425) should return 381."' + testString: 'assert.equal(gray(true,425),381,"gray(true,425) should return 381.");' + - text: "'gray(true,870) should return 725."' + testString: 'assert.equal(gray(true,870),725,"gray(true,870) should return 725.");' + - text: "'gray(false,233) should return 177."' + testString: 'assert.equal(gray(false,233),177,"gray(false,233) should return 177.");' + - text: "'gray(false,381) should return 425."' + testString: 'assert.equal(gray(false,381),425,"gray(false,381) should return 425.");' + - text: "'gray(false,725) should return 870."' + testString: 'assert.equal(gray(false,725),870,"gray(false,725) should return 870.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/greatest-common-divisor.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/greatest-common-divisor.english.md index b8ae23dc12..c14a938baa 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/greatest-common-divisor.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/greatest-common-divisor.english.md @@ -19,22 +19,22 @@ Write a function that returns the greatest common divisor of two integers. ```yml tests: - - text: '''gcd should be a function.''' - testString: 'assert(typeof gcd==''function'',''gcd should be a function.'');' - - text: '''gcd(24,36) should return a number.''' - testString: 'assert(typeof gcd(24,36)==''number'',''gcd(24,36) should return a number.'');' - - text: '''gcd(24,36) should return 12.''' - testString: 'assert.equal(gcd(24,36),12,''gcd(24,36) should return 12.'');' - - text: '''gcd(30,48) should return 6.''' - testString: 'assert.equal(gcd(30,48),6,''gcd(30,48) should return 6.'');' - - text: '''gcd(10,15) should return 5.''' - testString: 'assert.equal(gcd(10,15),5,''gcd(10,15) should return 5.'');' - - text: '''gcd(100,25) should return 25.''' - testString: 'assert.equal(gcd(100,25),25,''gcd(100,25) should return 25.'');' - - text: '''gcd(13,250) should return 1.''' - testString: 'assert.equal(gcd(13,250),1,''gcd(13,250) should return 1.'');' - - text: '''gcd(1300,250) should return 50.''' - testString: 'assert.equal(gcd(1300,250),50,''gcd(1300,250) should return 50.'');' + - text: "'gcd should be a function."' + testString: 'assert(typeof gcd=="function","gcd should be a function.");' + - text: "'gcd(24,36) should return a number."' + testString: 'assert(typeof gcd(24,36)=="number","gcd(24,36) should return a number.");' + - text: "'gcd(24,36) should return 12."' + testString: 'assert.equal(gcd(24,36),12,"gcd(24,36) should return 12.");' + - text: "'gcd(30,48) should return 6."' + testString: 'assert.equal(gcd(30,48),6,"gcd(30,48) should return 6.");' + - text: "'gcd(10,15) should return 5."' + testString: 'assert.equal(gcd(10,15),5,"gcd(10,15) should return 5.");' + - text: "'gcd(100,25) should return 25."' + testString: 'assert.equal(gcd(100,25),25,"gcd(100,25) should return 25.");' + - text: "'gcd(13,250) should return 1."' + testString: 'assert.equal(gcd(13,250),1,"gcd(13,250) should return 1.");' + - text: "'gcd(1300,250) should return 50."' + testString: 'assert.equal(gcd(1300,250),50,"gcd(1300,250) should return 50.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/greatest-subsequential-sum.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/greatest-subsequential-sum.english.md index d266abf542..4ad32ee033 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/greatest-subsequential-sum.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/greatest-subsequential-sum.english.md @@ -20,22 +20,22 @@ An empty subsequence is considered to have the sum of \( 0 \); thus if all elem ```yml tests: - - text: '''maximumSubsequence should be a function.''' - testString: 'assert(typeof maximumSubsequence==''function'',''maximumSubsequence should be a function.'');' - - text: '''maximumSubsequence(''+JSON.stringify(tests[0])+'') should return an array.''' - testString: 'assert(Array.isArray(maximumSubsequence(tests[0])),''maximumSubsequence(''+JSON.stringify(tests[0])+'') should return an array.'');' - - text: '''maximumSubsequence(''+JSON.stringify(tests[0])+'') should return ''+JSON.stringify(results[0])+''.''' - testString: 'assert.deepEqual(maximumSubsequence(tests[0]),results[0],''maximumSubsequence(''+JSON.stringify(tests[0])+'') should return ''+JSON.stringify(results[0])+''.'');' - - text: '''maximumSubsequence(''+JSON.stringify(tests[1])+'') should return ''+JSON.stringify(results[1])+''.''' - testString: 'assert.deepEqual(maximumSubsequence(tests[1]),results[1],''maximumSubsequence(''+JSON.stringify(tests[1])+'') should return ''+JSON.stringify(results[1])+''.'');' - - text: '''maximumSubsequence(''+JSON.stringify(tests[2])+'') should return ''+JSON.stringify(results[2])+''.''' - testString: 'assert.deepEqual(maximumSubsequence(tests[2]),results[2],''maximumSubsequence(''+JSON.stringify(tests[2])+'') should return ''+JSON.stringify(results[2])+''.'');' - - text: '''maximumSubsequence(''+JSON.stringify(tests[3])+'') should return ''+JSON.stringify(results[3])+''.''' - testString: 'assert.deepEqual(maximumSubsequence(tests[3]),results[3],''maximumSubsequence(''+JSON.stringify(tests[3])+'') should return ''+JSON.stringify(results[3])+''.'');' - - text: '''maximumSubsequence(''+JSON.stringify(tests[4])+'') should return ''+JSON.stringify(results[4])+''.''' - testString: 'assert.deepEqual(maximumSubsequence(tests[4]),results[4],''maximumSubsequence(''+JSON.stringify(tests[4])+'') should return ''+JSON.stringify(results[4])+''.'');' - - text: '''maximumSubsequence(''+JSON.stringify(tests[5])+'') should return ''+JSON.stringify(results[5])+''.''' - testString: 'assert.deepEqual(maximumSubsequence(tests[5]),results[5],''maximumSubsequence(''+JSON.stringify(tests[5])+'') should return ''+JSON.stringify(results[5])+''.'');' + - text: "'maximumSubsequence should be a function."' + testString: 'assert(typeof maximumSubsequence=="function","maximumSubsequence should be a function.");' + - text: "'maximumSubsequence("+JSON.stringify(tests[0])+") should return an array."' + testString: 'assert(Array.isArray(maximumSubsequence(tests[0])),"maximumSubsequence("+JSON.stringify(tests[0])+") should return an array.");' + - text: "'maximumSubsequence("+JSON.stringify(tests[0])+") should return "+JSON.stringify(results[0])+"."' + testString: 'assert.deepEqual(maximumSubsequence(tests[0]),results[0],"maximumSubsequence("+JSON.stringify(tests[0])+") should return "+JSON.stringify(results[0])+".");' + - text: "'maximumSubsequence("+JSON.stringify(tests[1])+") should return "+JSON.stringify(results[1])+"."' + testString: 'assert.deepEqual(maximumSubsequence(tests[1]),results[1],"maximumSubsequence("+JSON.stringify(tests[1])+") should return "+JSON.stringify(results[1])+".");' + - text: "'maximumSubsequence("+JSON.stringify(tests[2])+") should return "+JSON.stringify(results[2])+"."' + testString: 'assert.deepEqual(maximumSubsequence(tests[2]),results[2],"maximumSubsequence("+JSON.stringify(tests[2])+") should return "+JSON.stringify(results[2])+".");' + - text: "'maximumSubsequence("+JSON.stringify(tests[3])+") should return "+JSON.stringify(results[3])+"."' + testString: 'assert.deepEqual(maximumSubsequence(tests[3]),results[3],"maximumSubsequence("+JSON.stringify(tests[3])+") should return "+JSON.stringify(results[3])+".");' + - text: "'maximumSubsequence("+JSON.stringify(tests[4])+") should return "+JSON.stringify(results[4])+"."' + testString: 'assert.deepEqual(maximumSubsequence(tests[4]),results[4],"maximumSubsequence("+JSON.stringify(tests[4])+") should return "+JSON.stringify(results[4])+".");' + - text: "'maximumSubsequence("+JSON.stringify(tests[5])+") should return "+JSON.stringify(results[5])+"."' + testString: 'assert.deepEqual(maximumSubsequence(tests[5]),results[5],"maximumSubsequence("+JSON.stringify(tests[5])+") should return "+JSON.stringify(results[5])+".");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/hailstone-sequence.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/hailstone-sequence.english.md index a65551abd1..10fbabff5c 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/hailstone-sequence.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/hailstone-sequence.english.md @@ -29,9 +29,9 @@ Show the number less than 100,000 which has the longest hailstone sequence toget ```yml tests: - text: hailstoneSequence is a function. - testString: 'assert(typeof hailstoneSequence === ''function'', ''hailstoneSequence is a function.'');' + testString: 'assert(typeof hailstoneSequence === "function", "hailstoneSequence is a function.");' - text: 'hailstoneSequence() should return [[27,82,41,124,8,4,2,1], [351, 77031]]' - testString: 'assert.deepEqual(hailstoneSequence(), res, ''hailstoneSequence() should return [[27,82,41,124,8,4,2,1], [351, 77031]]'');' + testString: 'assert.deepEqual(hailstoneSequence(), res, "hailstoneSequence() should return [[27,82,41,124,8,4,2,1], [351, 77031]]");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/happy-numbers.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/happy-numbers.english.md index e8341648fa..69ddee960c 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/happy-numbers.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/happy-numbers.english.md @@ -22,31 +22,31 @@ challengeType: 5 ```yml tests: - text: happy is a function. - testString: 'assert(typeof happy === ''function'', ''happy is a function.'');' + testString: 'assert(typeof happy === "function", "happy is a function.");' - text: happy(1) should return a boolean. - testString: 'assert(typeof happy(1) === ''boolean'', ''happy(1) should return a boolean.'');' + testString: 'assert(typeof happy(1) === "boolean", "happy(1) should return a boolean.");' - text: happy(1) should return true. - testString: 'assert(happy(1), ''happy(1) should return true.'');' + testString: 'assert(happy(1), "happy(1) should return true.");' - text: happy(2) should return false. - testString: 'assert(!happy(2), ''happy(2) should return false.'');' + testString: 'assert(!happy(2), "happy(2) should return false.");' - text: happy(7) should return true. - testString: 'assert(happy(7), ''happy(7) should return true.'');' + testString: 'assert(happy(7), "happy(7) should return true.");' - text: happy(10) should return true. - testString: 'assert(happy(10), ''happy(10) should return true.'');' + testString: 'assert(happy(10), "happy(10) should return true.");' - text: happy(13) should return true. - testString: 'assert(happy(13), ''happy(13) should return true.'');' + testString: 'assert(happy(13), "happy(13) should return true.");' - text: happy(19) should return true. - testString: 'assert(happy(19), ''happy(19) should return true.'');' + testString: 'assert(happy(19), "happy(19) should return true.");' - text: happy(23) should return true. - testString: 'assert(happy(23), ''happy(23) should return true.'');' + testString: 'assert(happy(23), "happy(23) should return true.");' - text: happy(28) should return true. - testString: 'assert(happy(28), ''happy(28) should return true.'');' + testString: 'assert(happy(28), "happy(28) should return true.");' - text: happy(31) should return true. - testString: 'assert(happy(31), ''happy(31) should return true.'');' + testString: 'assert(happy(31), "happy(31) should return true.");' - text: 'happy(32) should return true:.' - testString: 'assert(happy(32), ''happy(32) should return true:.'');' + testString: 'assert(happy(32), "happy(32) should return true:.");' - text: happy(33) should return false. - testString: 'assert(!happy(33), ''happy(33) should return false.'');' + testString: 'assert(!happy(33), "happy(33) should return false.");' ``` 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 ed544e3b0a..0d9ebe50b6 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 @@ -23,9 +23,9 @@ Task: ```yml tests: - text: isHarshadOrNiven is a function. - testString: 'assert(typeof isHarshadOrNiven === ''function'', ''isHarshadOrNiven is a function.'');' + testString: 'assert(typeof isHarshadOrNiven === "function", "isHarshadOrNiven is a function.");' - text: 'isHarshadOrNiven() should return {"firstTwenty": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 18, 20, 21, 24, 27, 30, 36, 40, 42],"firstOver1000": 1002}' - testString: 'assert.deepEqual(isHarshadOrNiven(), res, ''isHarshadOrNiven() should return {"firstTwenty": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 18, 20, 21, 24, 27, 30, 36, 40, 42],"firstOver1000": 1002}'');' + testString: 'assert.deepEqual(isHarshadOrNiven(), res, "isHarshadOrNiven() should return {"firstTwenty": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 18, 20, 21, 24, 27, 30, 36, 40, 42],"firstOver1000": 1002}");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/hash-from-two-arrays.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/hash-from-two-arrays.english.md index 8b460588ab..b4eac36adb 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/hash-from-two-arrays.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/hash-from-two-arrays.english.md @@ -23,19 +23,19 @@ Related task: ```yml tests: - text: arrToObj is a function. - testString: 'assert(typeof arrToObj === ''function'', ''arrToObj is a function.'');' + testString: 'assert(typeof arrToObj === "function", "arrToObj is a function.");' - text: 'arrToObj([1, 2, 3, 4, 5], ["a", "b", "c", "d", "e"]) should return { 1: "a", 2: "b", 3: "c", 4: "d", 5: "e" }' - testString: 'assert.deepEqual(arrToObj(...testCases[0]), res[0], ''arrToObj([1, 2, 3, 4, 5], ["a", "b", "c", "d", "e"]) should return { 1: "a", 2: "b", 3: "c", 4: "d", 5: "e" }'');' + testString: 'assert.deepEqual(arrToObj(...testCases[0]), res[0], "arrToObj([1, 2, 3, 4, 5], ["a", "b", "c", "d", "e"]) should return { 1: "a", 2: "b", 3: "c", 4: "d", 5: "e" }");' - text: 'arrToObj([1, 2, 3, 4, 5], ["a", "b", "c", "d"]) should return { 1: "a", 2: "b", 3: "c", 4: "d", 5: undefined }' - testString: 'assert.deepEqual(arrToObj(...testCases[1]), res[1], ''arrToObj([1, 2, 3, 4, 5], ["a", "b", "c", "d"]) should return { 1: "a", 2: "b", 3: "c", 4: "d", 5: undefined }'');' + testString: 'assert.deepEqual(arrToObj(...testCases[1]), res[1], "arrToObj([1, 2, 3, 4, 5], ["a", "b", "c", "d"]) should return { 1: "a", 2: "b", 3: "c", 4: "d", 5: undefined }");' - text: 'arrToObj([1, 2, 3], ["a", "b", "c", "d", "e"]) should return { 1: "a", 2: "b", 3: "c" }' - testString: 'assert.deepEqual(arrToObj(...testCases[2]), res[2], ''arrToObj([1, 2, 3], ["a", "b", "c", "d", "e"]) should return { 1: "a", 2: "b", 3: "c" }'');' + testString: 'assert.deepEqual(arrToObj(...testCases[2]), res[2], "arrToObj([1, 2, 3], ["a", "b", "c", "d", "e"]) should return { 1: "a", 2: "b", 3: "c" }");' - text: 'arrToObj(["a", "b", "c", "d", "e"], [1, 2, 3, 4, 5]) should return { "a": 1, "b": 2, "c": 3 , "d": 4, "e": 5 }' - testString: 'assert.deepEqual(arrToObj(...testCases[3]), res[3], ''arrToObj(["a", "b", "c", "d", "e"], [1, 2, 3, 4, 5]) should return { "a": 1, "b": 2, "c": 3 , "d": 4, "e": 5 }'');' + testString: 'assert.deepEqual(arrToObj(...testCases[3]), res[3], "arrToObj(["a", "b", "c", "d", "e"], [1, 2, 3, 4, 5]) should return { "a": 1, "b": 2, "c": 3 , "d": 4, "e": 5 }");' - text: 'arrToObj(["a", "b", "c", "d", "e"], [1, 2, 3, 4]) should return { "a": 1, "b": 2, "c": 3 , "d": 4, "e": undefined }' - testString: 'assert.deepEqual(arrToObj(...testCases[4]), res[4], ''arrToObj(["a", "b", "c", "d", "e"], [1, 2, 3, 4]) should return { "a": 1, "b": 2, "c": 3 , "d": 4, "e": undefined }'');' + testString: 'assert.deepEqual(arrToObj(...testCases[4]), res[4], "arrToObj(["a", "b", "c", "d", "e"], [1, 2, 3, 4]) should return { "a": 1, "b": 2, "c": 3 , "d": 4, "e": undefined }");' - text: 'arrToObj(["a", "b", "c"], [1, 2, 3, 4, 5]) should return { "a": 1, "b": 2, "c": 3 }' - testString: 'assert.deepEqual(arrToObj(...testCases[5]), res[5], ''arrToObj(["a", "b", "c"], [1, 2, 3, 4, 5]) should return { "a": 1, "b": 2, "c": 3 }'');' + testString: 'assert.deepEqual(arrToObj(...testCases[5]), res[5], "arrToObj(["a", "b", "c"], [1, 2, 3, 4, 5]) should return { "a": 1, "b": 2, "c": 3 }");' ``` 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 b36fb08df7..ea0cfb374c 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 @@ -172,9 +172,9 @@ Test-case ```yml tests: - text: hashJoin is a function. - testString: 'assert(typeof hashJoin === ''function'', ''hashJoin is a function.'');' + testString: 'assert(typeof hashJoin === "function", "hashJoin is a function.");' - text: 'hashJoin([{ age: 27, name: "Jonah" }, { age: 18, name: "Alan" }, { age: 28, name: "Glory" }, { age: 18, name: "Popeye" }, { age: 28, name: "Alan" }], [{ character: "Jonah", nemesis: "Whales" }, { character: "Jonah", nemesis: "Spiders" }, { character: "Alan", nemesis: "Ghosts" }, { character:"Alan", nemesis: "Zombies" }, { character: "Glory", nemesis: "Buffy" }, { character: "Bob", nemesis: "foo" }]) should return [{"A_age": 27,"A_name": "Jonah", "B_character": "Jonah", "B_nemesis": "Whales"}, {"A_age": 27,"A_name": "Jonah", "B_character": "Jonah", "B_nemesis": "Spiders"}, {"A_age": 18,"A_name": "Alan", "B_character": "Alan", "B_nemesis": "Ghosts"}, {"A_age": 18,"A_name": "Alan", "B_character": "Alan", "B_nemesis": "Zombies"}, {"A_age": 28,"A_name": "Glory", "B_character": "Glory", "B_nemesis": "Buffy"}, {"A_age": 28,"A_name": "Alan", "B_character": "Alan", "B_nemesis": "Ghosts"}, {"A_age": 28,"A_name": "Alan", "B_character": "Alan", "B_nemesis": "Zombies"}]' - testString: 'assert.deepEqual(hashJoin(hash1, hash2), res, ''hashJoin([{ age: 27, name: "Jonah" }, { age: 18, name: "Alan" }, { age: 28, name: "Glory" }, { age: 18, name: "Popeye" }, { age: 28, name: "Alan" }], [{ character: "Jonah", nemesis: "Whales" }, { character: "Jonah", nemesis: "Spiders" }, { character: "Alan", nemesis: "Ghosts" }, { character:"Alan", nemesis: "Zombies" }, { character: "Glory", nemesis: "Buffy" }, { character: "Bob", nemesis: "foo" }]) should return [{"A_age": 27,"A_name": "Jonah", "B_character": "Jonah", "B_nemesis": "Whales"}, {"A_age": 27,"A_name": "Jonah", "B_character": "Jonah", "B_nemesis": "Spiders"}, {"A_age": 18,"A_name": "Alan", "B_character": "Alan", "B_nemesis": "Ghosts"}, {"A_age": 18,"A_name": "Alan", "B_character": "Alan", "B_nemesis": "Zombies"}, {"A_age": 28,"A_name": "Glory", "B_character": "Glory", "B_nemesis": "Buffy"}, {"A_age": 28,"A_name": "Alan", "B_character": "Alan", "B_nemesis": "Ghosts"}, {"A_age": 28,"A_name": "Alan", "B_character": "Alan", "B_nemesis": "Zombies"}]'');' + testString: 'assert.deepEqual(hashJoin(hash1, hash2), res, "hashJoin([{ age: 27, name: "Jonah" }, { age: 18, name: "Alan" }, { age: 28, name: "Glory" }, { age: 18, name: "Popeye" }, { age: 28, name: "Alan" }], [{ character: "Jonah", nemesis: "Whales" }, { character: "Jonah", nemesis: "Spiders" }, { character: "Alan", nemesis: "Ghosts" }, { character:"Alan", nemesis: "Zombies" }, { character: "Glory", nemesis: "Buffy" }, { character: "Bob", nemesis: "foo" }]) should return [{"A_age": 27,"A_name": "Jonah", "B_character": "Jonah", "B_nemesis": "Whales"}, {"A_age": 27,"A_name": "Jonah", "B_character": "Jonah", "B_nemesis": "Spiders"}, {"A_age": 18,"A_name": "Alan", "B_character": "Alan", "B_nemesis": "Ghosts"}, {"A_age": 18,"A_name": "Alan", "B_character": "Alan", "B_nemesis": "Zombies"}, {"A_age": 28,"A_name": "Glory", "B_character": "Glory", "B_nemesis": "Buffy"}, {"A_age": 28,"A_name": "Alan", "B_character": "Alan", "B_nemesis": "Ghosts"}, {"A_age": 28,"A_name": "Alan", "B_character": "Alan", "B_nemesis": "Zombies"}]");' ``` 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 b1b57ddbcc..48c8fb849d 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 @@ -26,15 +26,15 @@ Task: ```yml tests: - text: heronianTriangle is a function. - testString: 'assert(typeof heronianTriangle === ''function'', ''heronianTriangle is a function.'');' + testString: 'assert(typeof heronianTriangle === "function", "heronianTriangle is a function.");' - text: 'heronianTriangle() should return [[3, 4, 5], [5, 5, 6], [5, 5, 8], [4, 13, 15], [5, 12, 13], [9, 10, 17], [3, 25, 26], [7, 15, 20], [10, 13, 13], [8, 15, 17]]' - testString: 'assert.deepEqual(heronianTriangle(testCases[0]), res[0], ''heronianTriangle() should return [[3, 4, 5], [5, 5, 6], [5, 5, 8], [4, 13, 15], [5, 12, 13], [9, 10, 17], [3, 25, 26], [7, 15, 20], [10, 13, 13], [8, 15, 17]]'');' + testString: 'assert.deepEqual(heronianTriangle(testCases[0]), res[0], "heronianTriangle() should return [[3, 4, 5], [5, 5, 6], [5, 5, 8], [4, 13, 15], [5, 12, 13], [9, 10, 17], [3, 25, 26], [7, 15, 20], [10, 13, 13], [8, 15, 17]]");' - text: 'heronianTriangle() should return [[3, 4, 5], [5, 5, 6], [5, 5, 8], [4, 13, 15], [5, 12, 13], [9, 10, 17], [3, 25, 26], [7, 15, 20], [10, 13, 13], [8, 15, 17], [13, 13, 24], [6, 25, 29], [11, 13, 20], [5, 29, 30], [13, 14, 15]],' - testString: 'assert.deepEqual(heronianTriangle(testCases[1]), res[1], ''heronianTriangle() should return [[3, 4, 5], [5, 5, 6], [5, 5, 8], [4, 13, 15], [5, 12, 13], [9, 10, 17], [3, 25, 26], [7, 15, 20], [10, 13, 13], [8, 15, 17], [13, 13, 24], [6, 25, 29], [11, 13, 20], [5, 29, 30], [13, 14, 15]],'');' + testString: 'assert.deepEqual(heronianTriangle(testCases[1]), res[1], "heronianTriangle() should return [[3, 4, 5], [5, 5, 6], [5, 5, 8], [4, 13, 15], [5, 12, 13], [9, 10, 17], [3, 25, 26], [7, 15, 20], [10, 13, 13], [8, 15, 17], [13, 13, 24], [6, 25, 29], [11, 13, 20], [5, 29, 30], [13, 14, 15]],");' - text: 'heronianTriangle() should return [[3, 4, 5], [5, 5, 6], [5, 5, 8], [4, 13, 15], [5, 12, 13], [9, 10, 17], [3, 25, 26], [7, 15, 20], [10, 13, 13], [8, 15, 17], [13, 13, 24], [6, 25, 29], [11, 13, 20], [5, 29, 30], [13, 14, 15], [10, 17, 21], [7, 24, 25], [8, 29, 35], [12, 17, 25], [4, 51, 53]],' - testString: 'assert.deepEqual(heronianTriangle(testCases[2]), res[2], ''heronianTriangle() should return [[3, 4, 5], [5, 5, 6], [5, 5, 8], [4, 13, 15], [5, 12, 13], [9, 10, 17], [3, 25, 26], [7, 15, 20], [10, 13, 13], [8, 15, 17], [13, 13, 24], [6, 25, 29], [11, 13, 20], [5, 29, 30], [13, 14, 15], [10, 17, 21], [7, 24, 25], [8, 29, 35], [12, 17, 25], [4, 51, 53]],'');' + testString: 'assert.deepEqual(heronianTriangle(testCases[2]), res[2], "heronianTriangle() should return [[3, 4, 5], [5, 5, 6], [5, 5, 8], [4, 13, 15], [5, 12, 13], [9, 10, 17], [3, 25, 26], [7, 15, 20], [10, 13, 13], [8, 15, 17], [13, 13, 24], [6, 25, 29], [11, 13, 20], [5, 29, 30], [13, 14, 15], [10, 17, 21], [7, 24, 25], [8, 29, 35], [12, 17, 25], [4, 51, 53]],");' - text: 'heronianTriangle() should return [[3, 4, 5], [5, 5, 6], [5, 5, 8], [4, 13, 15], [5, 12, 13], [9, 10, 17], [3, 25, 26], [7, 15, 20], [10, 13, 13], [8, 15, 17], [13, 13, 24], [6, 25, 29], [11, 13, 20], [5, 29, 30], [13, 14, 15], [10, 17, 21], [7, 24, 25], [8, 29, 35], [12, 17, 25], [4, 51, 53], [19, 20, 37],[16, 17, 17], [17, 17, 30], [16, 25, 39], [13, 20, 21]]' - testString: 'assert.deepEqual(heronianTriangle(testCases[3]), res[3], ''heronianTriangle() should return [[3, 4, 5], [5, 5, 6], [5, 5, 8], [4, 13, 15], [5, 12, 13], [9, 10, 17], [3, 25, 26], [7, 15, 20], [10, 13, 13], [8, 15, 17], [13, 13, 24], [6, 25, 29], [11, 13, 20], [5, 29, 30], [13, 14, 15], [10, 17, 21], [7, 24, 25], [8, 29, 35], [12, 17, 25], [4, 51, 53], [19, 20, 37],[16, 17, 17], [17, 17, 30], [16, 25, 39], [13, 20, 21]]'');' + testString: 'assert.deepEqual(heronianTriangle(testCases[3]), res[3], "heronianTriangle() should return [[3, 4, 5], [5, 5, 6], [5, 5, 8], [4, 13, 15], [5, 12, 13], [9, 10, 17], [3, 25, 26], [7, 15, 20], [10, 13, 13], [8, 15, 17], [13, 13, 24], [6, 25, 29], [11, 13, 20], [5, 29, 30], [13, 14, 15], [10, 17, 21], [7, 24, 25], [8, 29, 35], [12, 17, 25], [4, 51, 53], [19, 20, 37],[16, 17, 17], [17, 17, 30], [16, 25, 39], [13, 20, 21]]");' ``` 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 b48bad1268..09239e86d2 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 @@ -31,29 +31,29 @@ Wikipedia: ffr is a function.");' - text: ffs is a function. - testString: 'assert(typeof ffs === ''function'', ''ffs is a function.'');' + testString: 'assert(typeof ffs === "function", "ffs is a function.");' - text: ffr should return integer. - testString: 'assert(Number.isInteger(ffr(1)), ''ffr should return integer.'');' + testString: 'assert(Number.isInteger(ffr(1)), "ffr should return integer.");' - text: ffs should return integer. - testString: 'assert(Number.isInteger(ffs(1)), ''ffs should return integer.'');' + testString: 'assert(Number.isInteger(ffs(1)), "ffs should return integer.");' - text: ffr() should return 69 - testString: 'assert.equal(ffr(ffrParamRes[0][0]), ffrParamRes[0][1], ''ffr() should return 69'');' + testString: 'assert.equal(ffr(ffrParamRes[0][0]), ffrParamRes[0][1], "ffr() should return 69");' - text: ffr() should return 1509 - testString: 'assert.equal(ffr(ffrParamRes[1][0]), ffrParamRes[1][1], ''ffr() should return 1509'');' + testString: 'assert.equal(ffr(ffrParamRes[1][0]), ffrParamRes[1][1], "ffr() should return 1509");' - text: ffr() should return 5764 - testString: 'assert.equal(ffr(ffrParamRes[2][0]), ffrParamRes[2][1], ''ffr() should return 5764'');' + testString: 'assert.equal(ffr(ffrParamRes[2][0]), ffrParamRes[2][1], "ffr() should return 5764");' - text: ffr() should return 526334 - testString: 'assert.equal(ffr(ffrParamRes[3][0]), ffrParamRes[3][1], ''ffr() should return 526334'');' + testString: 'assert.equal(ffr(ffrParamRes[3][0]), ffrParamRes[3][1], "ffr() should return 526334");' - text: ffs() should return 14 - testString: 'assert.equal(ffs(ffsParamRes[0][0]), ffsParamRes[0][1], ''ffs() should return 14'');' + testString: 'assert.equal(ffs(ffsParamRes[0][0]), ffsParamRes[0][1], "ffs() should return 14");' - text: ffs() should return 59 - testString: 'assert.equal(ffs(ffsParamRes[1][0]), ffsParamRes[1][1], ''ffs() should return 59'');' + testString: 'assert.equal(ffs(ffsParamRes[1][0]), ffsParamRes[1][1], "ffs() should return 59");' - text: ffs() should return 112 - testString: 'assert.equal(ffs(ffsParamRes[2][0]), ffsParamRes[2][1], ''ffs() should return 112'');' + testString: 'assert.equal(ffs(ffsParamRes[2][0]), ffsParamRes[2][1], "ffs() should return 112");' - text: ffs() should return 1041 - testString: 'assert.equal(ffs(ffsParamRes[3][0]), ffsParamRes[3][1], ''ffs() should return 1041'');' + testString: 'assert.equal(ffs(ffsParamRes[3][0]), ffsParamRes[3][1], "ffs() should return 1041");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/hofstadter-q-sequence.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/hofstadter-q-sequence.english.md index 193f9b96d7..f3e8f6a438 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/hofstadter-q-sequence.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/hofstadter-q-sequence.english.md @@ -24,17 +24,17 @@ Implement the Hofstadter Q Sequence equation into JavaScript ```yml tests: - text: hofstadterQ is a function. - testString: 'assert(typeof hofstadterQ === ''function'', ''hofstadterQ is a function.'');' + testString: 'assert(typeof hofstadterQ === "function", "hofstadterQ is a function.");' - text: hofstadterQ() should return integer - testString: 'assert(Number.isInteger(hofstadterQ(1000)), ''hofstadterQ() should return integer'');' + testString: 'assert(Number.isInteger(hofstadterQ(1000)), "hofstadterQ() should return integer");' - text: hofstadterQ(1000) should return 502 - testString: 'assert.equal(hofstadterQ(testCase[0]), res[0], ''hofstadterQ(1000) should return 502'');' + testString: 'assert.equal(hofstadterQ(testCase[0]), res[0], "hofstadterQ(1000) should return 502");' - text: hofstadterQ(1500) should return 755 - testString: 'assert.equal(hofstadterQ(testCase[1]), res[1], ''hofstadterQ(1500) should return 755'');' + testString: 'assert.equal(hofstadterQ(testCase[1]), res[1], "hofstadterQ(1500) should return 755");' - text: hofstadterQ(2000) should return 1005 - testString: 'assert.equal(hofstadterQ(testCase[2]), res[2], ''hofstadterQ(2000) should return 1005'');' + testString: 'assert.equal(hofstadterQ(testCase[2]), res[2], "hofstadterQ(2000) should return 1005");' - text: hofstadterQ(2500) should return 1261 - testString: 'assert.equal(hofstadterQ(testCase[3]), res[3], ''hofstadterQ(2500) should return 1261'');' + testString: 'assert.equal(hofstadterQ(testCase[3]), res[3], "hofstadterQ(2500) should return 1261");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/i-before-e-except-after-c.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/i-before-e-except-after-c.english.md index 2b553dad0f..90a1ec9fcd 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/i-before-e-except-after-c.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/i-before-e-except-after-c.english.md @@ -23,22 +23,22 @@ Write a function that accepts a word and check if the word follows this rule. Th ```yml tests: - - text: '''IBeforeExceptC should be a function.''' - testString: 'assert(typeof IBeforeExceptC==''function'',''IBeforeExceptC should be a function.'');' - - text: '''IBeforeExceptC("receive") should return a boolean.''' - testString: 'assert(typeof IBeforeExceptC("receive")==''boolean'',''IBeforeExceptC("receive") should return a boolean.'');' - - text: '''IBeforeExceptC("receive") should return true.''' - testString: 'assert.equal(IBeforeExceptC("receive"),true,''IBeforeExceptC("receive") should return true.'');' - - text: '''IBeforeExceptC("science") should return false.''' - testString: 'assert.equal(IBeforeExceptC("science"),false,''IBeforeExceptC("science") should return false.'');' - - text: '''IBeforeExceptC("imperceivable") should return true.''' - testString: 'assert.equal(IBeforeExceptC("imperceivable"),true,''IBeforeExceptC("imperceivable") should return true.'');' - - text: '''IBeforeExceptC("inconceivable") should return true.''' - testString: 'assert.equal(IBeforeExceptC("inconceivable"),true,''IBeforeExceptC("inconceivable") should return true.'');' - - text: '''IBeforeExceptC("insufficient") should return false.''' - testString: 'assert.equal(IBeforeExceptC("insufficient"),false,''IBeforeExceptC("insufficient") should return false.'');' - - text: '''IBeforeExceptC("omniscient") should return false.''' - testString: 'assert.equal(IBeforeExceptC("omniscient"),false,''IBeforeExceptC("omniscient") should return false.'');' + - text: "'IBeforeExceptC should be a function."' + testString: 'assert(typeof IBeforeExceptC=="function","IBeforeExceptC should be a function.");' + - text: "'IBeforeExceptC("receive") should return a boolean."' + testString: 'assert(typeof IBeforeExceptC("receive")=="boolean","IBeforeExceptC("receive") should return a boolean.");' + - text: "'IBeforeExceptC("receive") should return true."' + testString: 'assert.equal(IBeforeExceptC("receive"),true,"IBeforeExceptC("receive") should return true.");' + - text: "'IBeforeExceptC("science") should return false."' + testString: 'assert.equal(IBeforeExceptC("science"),false,"IBeforeExceptC("science") should return false.");' + - text: "'IBeforeExceptC("imperceivable") should return true."' + testString: 'assert.equal(IBeforeExceptC("imperceivable"),true,"IBeforeExceptC("imperceivable") should return true.");' + - text: "'IBeforeExceptC("inconceivable") should return true."' + testString: 'assert.equal(IBeforeExceptC("inconceivable"),true,"IBeforeExceptC("inconceivable") should return true.");' + - text: "'IBeforeExceptC("insufficient") should return false."' + testString: 'assert.equal(IBeforeExceptC("insufficient"),false,"IBeforeExceptC("insufficient") should return false.");' + - text: "'IBeforeExceptC("omniscient") should return false."' + testString: 'assert.equal(IBeforeExceptC("omniscient"),false,"IBeforeExceptC("omniscient") should return false.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/iban.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/iban.english.md index 759f36c2ac..3fb8308d4a 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/iban.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/iban.english.md @@ -27,20 +27,20 @@ Write a function that takes IBAN string as parameter. If it is valid return true ```yml tests: - - text: '''isValid should be a function.''' - testString: 'assert(typeof isValid==''function'',''isValid should be a function.'');' - - text: '''isValid("''+tests[0]+''") should return a boolean.''' - testString: 'assert(typeof isValid(tests[0])==''boolean'',''isValid("''+tests[0]+''") should return a boolean.'');' - - text: '''isValid("''+tests[0]+''") should return true.''' - testString: 'assert.equal(isValid(tests[0]),true,''isValid("''+tests[0]+''") should return true.'');' - - text: '''isValid("''+tests[1]+''") should return false.''' - testString: 'assert.equal(isValid(tests[1]),false,''isValid("''+tests[1]+''") should return false.'');' - - text: '''isValid("''+tests[2]+''") should return false.''' - testString: 'assert.equal(isValid(tests[2]),false,''isValid("''+tests[2]+''") should return false.'');' - - text: '''isValid("''+tests[3]+''") should return false.''' - testString: 'assert.equal(isValid(tests[3]),false,''isValid("''+tests[3]+''") should return false.'');' - - text: '''isValid("''+tests[4]+''") should return true.''' - testString: 'assert.equal(isValid(tests[4]),true,''isValid("''+tests[4]+''") should return true.'');' + - text: "'isValid should be a function."' + testString: 'assert(typeof isValid=="function","isValid should be a function.");' + - text: "'isValid(""+tests[0]+"") should return a boolean."' + testString: 'assert(typeof isValid(tests[0])=="boolean","isValid(""+tests[0]+"") should return a boolean.");' + - text: "'isValid(""+tests[0]+"") should return true."' + testString: 'assert.equal(isValid(tests[0]),true,"isValid(""+tests[0]+"") should return true.");' + - text: "'isValid(""+tests[1]+"") should return false."' + testString: 'assert.equal(isValid(tests[1]),false,"isValid(""+tests[1]+"") should return false.");' + - text: "'isValid(""+tests[2]+"") should return false."' + testString: 'assert.equal(isValid(tests[2]),false,"isValid(""+tests[2]+"") should return false.");' + - text: "'isValid(""+tests[3]+"") should return false."' + testString: 'assert.equal(isValid(tests[3]),false,"isValid(""+tests[3]+"") should return false.");' + - text: "'isValid(""+tests[4]+"") should return true."' + testString: 'assert.equal(isValid(tests[4]),true,"isValid(""+tests[4]+"") should return true.");' ``` @@ -87,12 +87,12 @@ function isValid (iban) { MC:27, MR:27, SM:27, AL:28, AZ:28, CY:28, DO:28, GT:28, HU:28, LB:28, PL:28, BR:29, PS:29, KW:30, MU:30, MT:31 } - iban = iban.replace(/\s/g, '') + iban = iban.replace(/\s/g, ") if (!iban.match(/^[\dA-Z]+$/)) return false var len = iban.length if (len != ibanLen[iban.substr(0,2)]) return false iban = iban.substr(4) + iban.substr(0,4) - for (var s='', i=0; iidMatrix should be a function."' + testString: 'assert(typeof idMatrix=="function","idMatrix should be a function.");' + - text: "'idMatrix(1) should return an array."' + testString: 'assert(Array.isArray(idMatrix(1)),"idMatrix(1) should return an array.");' + - text: "'idMatrix(1) should return "+JSON.stringify(results[0])+"."' + testString: 'assert.deepEqual(idMatrix(1),results[0],"idMatrix(1) should return "+JSON.stringify(results[0])+".");' + - text: "'idMatrix(2) should return "+JSON.stringify(results[1])+"."' + testString: 'assert.deepEqual(idMatrix(2),results[1],"idMatrix(2) should return "+JSON.stringify(results[1])+".");' + - text: "'idMatrix(3) should return "+JSON.stringify(results[2])+"."' + testString: 'assert.deepEqual(idMatrix(3),results[2],"idMatrix(3) should return "+JSON.stringify(results[2])+".");' + - text: "'idMatrix(4) should return "+JSON.stringify(results[3])+"."' + testString: 'assert.deepEqual(idMatrix(4),results[3],"idMatrix(4) should return "+JSON.stringify(results[3])+".");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/iterated-digits-squaring.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/iterated-digits-squaring.english.md index c6a9f94cdf..2642d1bac3 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/iterated-digits-squaring.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/iterated-digits-squaring.english.md @@ -22,22 +22,22 @@ Write a function that takes a number as a parameter and returns 1 or 89 after pe ```yml tests: - - text: '''iteratedSquare should be a function.''' - testString: 'assert(typeof iteratedSquare==''function'',''iteratedSquare should be a function.'');' - - text: '''iteratedSquare(4) should return a number.''' - testString: 'assert(typeof iteratedSquare(4)==''number'',''iteratedSquare(4) should return a number.'');' - - text: '''iteratedSquare(4) should return 89.''' - testString: 'assert.equal(iteratedSquare(4),89,''iteratedSquare(4) should return 89.'');' - - text: '''iteratedSquare(7) should return 1.''' - testString: 'assert.equal(iteratedSquare(7),1,''iteratedSquare(7) should return 1.'');' - - text: '''iteratedSquare(15) should return 89.''' - testString: 'assert.equal(iteratedSquare(15),89,''iteratedSquare(15) should return 89.'');' - - text: '''iteratedSquare(20) should return 89.''' - testString: 'assert.equal(iteratedSquare(20),89,''iteratedSquare(20) should return 89.'');' - - text: '''iteratedSquare(70) should return 1.''' - testString: 'assert.equal(iteratedSquare(70),1,''iteratedSquare(70) should return 1.'');' - - text: '''iteratedSquare(100) should return 1.''' - testString: 'assert.equal(iteratedSquare(100),1,''iteratedSquare(100) should return 1.'');' + - text: "'iteratedSquare should be a function."' + testString: 'assert(typeof iteratedSquare=="function","iteratedSquare should be a function.");' + - text: "'iteratedSquare(4) should return a number."' + testString: 'assert(typeof iteratedSquare(4)=="number","iteratedSquare(4) should return a number.");' + - text: "'iteratedSquare(4) should return 89."' + testString: 'assert.equal(iteratedSquare(4),89,"iteratedSquare(4) should return 89.");' + - text: "'iteratedSquare(7) should return 1."' + testString: 'assert.equal(iteratedSquare(7),1,"iteratedSquare(7) should return 1.");' + - text: "'iteratedSquare(15) should return 89."' + testString: 'assert.equal(iteratedSquare(15),89,"iteratedSquare(15) should return 89.");' + - text: "'iteratedSquare(20) should return 89."' + testString: 'assert.equal(iteratedSquare(20),89,"iteratedSquare(20) should return 89.");' + - text: "'iteratedSquare(70) should return 1."' + testString: 'assert.equal(iteratedSquare(70),1,"iteratedSquare(70) should return 1.");' + - text: "'iteratedSquare(100) should return 1."' + testString: 'assert.equal(iteratedSquare(100),1,"iteratedSquare(100) should return 1.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/jaro-distance.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/jaro-distance.english.md index c560d940dc..e596fa97ea 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/jaro-distance.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/jaro-distance.english.md @@ -28,20 +28,20 @@ Write a function a that takes two strings as parameters and returns the associat ```yml tests: - - text: '''jaro should be a function.''' - testString: 'assert(typeof jaro==''function'',''jaro should be a function.'');' - - text: '''jaro("''+tests[0][0]+''","''+tests[0][1]+''") should return a number.''' - testString: 'assert(typeof jaro(tests[0][0],tests[0][1])==''number'',''jaro() should return a number.'');' - - text: '''jaro("''+tests[0][0]+''","''+tests[0][1]+''") should return ''+results[0]+''.''' - testString: 'assert.equal(jaro(tests[0][0],tests[0][1]),results[0],''jaro("''+tests[0][0]+''","''+tests[0][1]+''") should return ''+results[0]+''.'');' - - text: '''jaro("''+tests[1][0]+''","''+tests[1][1]+''") should return ''+results[1]+''.''' - testString: 'assert.equal(jaro(tests[1][0],tests[1][1]),results[1],''jaro("''+tests[1][0]+''","''+tests[1][1]+''") should return ''+results[1]+''.'');' - - text: '''jaro("''+tests[2][0]+''","''+tests[2][1]+''") should return ''+results[2]+''.''' - testString: 'assert.equal(jaro(tests[2][0],tests[2][1]),results[2],''jaro("''+tests[2][0]+''","''+tests[2][1]+''") should return ''+results[2]+''.'');' - - text: '''jaro("''+tests[3][0]+''","''+tests[3][1]+''") should return ''+results[3]+''.''' - testString: 'assert.equal(jaro(tests[3][0],tests[3][1]),results[3],''jaro("''+tests[3][0]+''","''+tests[3][1]+''") should return ''+results[3]+''.'');' - - text: '''jaro("''+tests[4][0]+''","''+tests[4][1]+''") should return ''+results[4]+''.''' - testString: 'assert.equal(jaro(tests[4][0],tests[4][1]),results[4],''jaro("''+tests[4][0]+''","''+tests[4][1]+''") should return ''+results[4]+''.'');' + - text: "'jaro should be a function."' + testString: 'assert(typeof jaro=="function","jaro should be a function.");' + - text: "'jaro(""+tests[0][0]+"",""+tests[0][1]+"") should return a number."' + testString: 'assert(typeof jaro(tests[0][0],tests[0][1])=="number","jaro() should return a number.");' + - text: "'jaro(""+tests[0][0]+"",""+tests[0][1]+"") should return "+results[0]+"."' + testString: 'assert.equal(jaro(tests[0][0],tests[0][1]),results[0],"jaro(""+tests[0][0]+"",""+tests[0][1]+"") should return "+results[0]+".");' + - text: "'jaro(""+tests[1][0]+"",""+tests[1][1]+"") should return "+results[1]+"."' + testString: 'assert.equal(jaro(tests[1][0],tests[1][1]),results[1],"jaro(""+tests[1][0]+"",""+tests[1][1]+"") should return "+results[1]+".");' + - text: "'jaro(""+tests[2][0]+"",""+tests[2][1]+"") should return "+results[2]+"."' + testString: 'assert.equal(jaro(tests[2][0],tests[2][1]),results[2],"jaro(""+tests[2][0]+"",""+tests[2][1]+"") should return "+results[2]+".");' + - text: "'jaro(""+tests[3][0]+"",""+tests[3][1]+"") should return "+results[3]+"."' + testString: 'assert.equal(jaro(tests[3][0],tests[3][1]),results[3],"jaro(""+tests[3][0]+"",""+tests[3][1]+"") should return "+results[3]+".");' + - text: "'jaro(""+tests[4][0]+"",""+tests[4][1]+"") should return "+results[4]+"."' + testString: 'assert.equal(jaro(tests[4][0],tests[4][1]),results[4],"jaro(""+tests[4][0]+"",""+tests[4][1]+"") should return "+results[4]+".");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/jortsort.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/jortsort.english.md index dbea4b3f6d..1b23947ca3 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/jortsort.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/jortsort.english.md @@ -20,22 +20,22 @@ jortSort is a function that takes a single array of comparable objects as its ar ```yml tests: - - text: '''jortsort should be a function.''' - testString: 'assert(typeof jortsort==''function'',''jortsort should be a function.'');' - - text: '''jortsort(''+JSON.stringify(tests[0])+'') should return a boolean.''' - testString: 'assert(typeof jortsort(tests[0].slice())==''boolean'',''jortsort(''+JSON.stringify(tests[0])+'') should return a boolean.'');' - - text: '''jortsort(''+JSON.stringify(tests[0])+'') should return true.''' - testString: 'assert.equal(jortsort(tests[0].slice()),true,''jortsort(''+JSON.stringify(tests[0])+'') should return true.'');' - - text: '''jortsort(''+JSON.stringify(tests[1])+'') should return false.''' - testString: 'assert.equal(jortsort(tests[1].slice()),false,''jortsort(''+JSON.stringify(tests[1])+'') should return false.'');' - - text: '''jortsort(''+JSON.stringify(tests[2])+'') should return false.''' - testString: 'assert.equal(jortsort(tests[2].slice()),false,''jortsort(''+JSON.stringify(tests[2])+'') should return false.'');' - - text: '''jortsort(''+JSON.stringify(tests[3])+'') should return true.''' - testString: 'assert.equal(jortsort(tests[3].slice()),true,''jortsort(''+JSON.stringify(tests[3])+'') should return true.'');' - - text: '''jortsort(''+JSON.stringify(tests[4])+'') should return false.''' - testString: 'assert.equal(jortsort(tests[4].slice()),false,''jortsort(''+JSON.stringify(tests[4])+'') should return false.'');' - - text: '''jortsort(''+JSON.stringify(tests[5])+'') should return true.''' - testString: 'assert.equal(jortsort(tests[5].slice()),true,''jortsort(''+JSON.stringify(tests[5])+'') should return true.'');' + - text: "'jortsort should be a function."' + testString: 'assert(typeof jortsort=="function","jortsort should be a function.");' + - text: "'jortsort("+JSON.stringify(tests[0])+") should return a boolean."' + testString: 'assert(typeof jortsort(tests[0].slice())=="boolean","jortsort("+JSON.stringify(tests[0])+") should return a boolean.");' + - text: "'jortsort("+JSON.stringify(tests[0])+") should return true."' + testString: 'assert.equal(jortsort(tests[0].slice()),true,"jortsort("+JSON.stringify(tests[0])+") should return true.");' + - text: "'jortsort("+JSON.stringify(tests[1])+") should return false."' + testString: 'assert.equal(jortsort(tests[1].slice()),false,"jortsort("+JSON.stringify(tests[1])+") should return false.");' + - text: "'jortsort("+JSON.stringify(tests[2])+") should return false."' + testString: 'assert.equal(jortsort(tests[2].slice()),false,"jortsort("+JSON.stringify(tests[2])+") should return false.");' + - text: "'jortsort("+JSON.stringify(tests[3])+") should return true."' + testString: 'assert.equal(jortsort(tests[3].slice()),true,"jortsort("+JSON.stringify(tests[3])+") should return true.");' + - text: "'jortsort("+JSON.stringify(tests[4])+") should return false."' + testString: 'assert.equal(jortsort(tests[4].slice()),false,"jortsort("+JSON.stringify(tests[4])+") should return false.");' + - text: "'jortsort("+JSON.stringify(tests[5])+") should return true."' + testString: 'assert.equal(jortsort(tests[5].slice()),true,"jortsort("+JSON.stringify(tests[5])+") should return true.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/josephus-problem.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/josephus-problem.english.md index 0bfae7a4fa..fdb6740f69 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/josephus-problem.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/josephus-problem.english.md @@ -27,20 +27,20 @@ Write a function that takes the initial number of prisoners and 'k' as parameter ```yml tests: - - text: '''josephus should be a function.''' - testString: 'assert(typeof josephus==''function'',''josephus should be a function.'');' - - text: '''josephus(30,3) should return a number.''' - testString: 'assert(typeof josephus(30,3)==''number'',''josephus(30,3) should return a number.'');' - - text: '''josephus(30,3) should return 29.''' - testString: 'assert.equal(josephus(30,3),29,''josephus(30,3) should return 29.'');' - - text: '''josephus(30,5) should return 3.''' - testString: 'assert.equal(josephus(30,5),3,''josephus(30,5) should return 3.'');' - - text: '''josephus(20,2) should return 9.''' - testString: 'assert.equal(josephus(20,2),9,''josephus(20,2) should return 9.'');' - - text: '''josephus(17,6) should return 2.''' - testString: 'assert.equal(josephus(17,6),2,''josephus(17,6) should return 2.'');' - - text: '''josephus(29,4) should return 2.''' - testString: 'assert.equal(josephus(29,4),2,''josephus(29,4) should return 2.'');' + - text: "'josephus should be a function."' + testString: 'assert(typeof josephus=="function","josephus should be a function.");' + - text: "'josephus(30,3) should return a number."' + testString: 'assert(typeof josephus(30,3)=="number","josephus(30,3) should return a number.");' + - text: "'josephus(30,3) should return 29."' + testString: 'assert.equal(josephus(30,3),29,"josephus(30,3) should return 29.");' + - text: "'josephus(30,5) should return 3."' + testString: 'assert.equal(josephus(30,5),3,"josephus(30,5) should return 3.");' + - text: "'josephus(20,2) should return 9."' + testString: 'assert.equal(josephus(20,2),9,"josephus(20,2) should return 9.");' + - text: "'josephus(17,6) should return 2."' + testString: 'assert.equal(josephus(17,6),2,"josephus(17,6) should return 2.");' + - text: "'josephus(29,4) should return 2."' + testString: 'assert.equal(josephus(29,4),2,"josephus(29,4) should return 2.");' ``` 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 637b1d0a54..385fc9edaf 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 @@ -40,7 +40,7 @@ Note that with the exception of “()"” (“\” if escaping

and turn it into a native datastructure. (see the -Pike, +Pike, Python and Ruby implementations for examples of native data structures.) @@ -58,11 +58,11 @@ for examples of native data structures.) ```yml tests: - text: parseSexpr is a function. - testString: 'assert(typeof parseSexpr === ''function'', ''parseSexpr is a function.'');' - - text: 'parseSexpr(''(data1 data2 data3)'') should return [''data1'', ''data2'', ''data3'']")' - testString: 'assert.deepEqual(parseSexpr(simpleSExpr), simpleSolution, "parseSexpr(''(data1 data2 data3)'') should return [''data1'', ''data2'', ''data3'']");' + testString: 'assert(typeof parseSexpr === "function", "parseSexpr is a function.");' + - text: 'parseSexpr("(data1 data2 data3)") should return ["data1", "data2", "data3"]")' + testString: 'assert.deepEqual(parseSexpr(simpleSExpr), simpleSolution, "parseSexpr("(data1 data2 data3)") should return ["data1", "data2", "data3"]");' - text: parseSexpr('(data1 data2 data3)') should return an array with 3 elements") - testString: 'assert.deepEqual(parseSexpr(basicSExpr), basicSolution, "parseSexpr(''(data1 data2 data3)'') should return an array with 3 elements");' + testString: 'assert.deepEqual(parseSexpr(basicSExpr), basicSolution, "parseSexpr("(data1 data2 data3)") should return an array with 3 elements");' ``` @@ -108,7 +108,7 @@ function parseSexpr(str) { else if (ti == '(') t[i] = '[', c += 1; else if (ti == ')') t[i] = ']', c -= 1; else if ((n = +ti) == ti) t[i] = n; - else t[i] = `'${ti.replace('\'', '\\\'')}'`; + else t[i] = `'${ti.replace('\", '\\\")}'`; if (i > 0 && ti != ']' && t[i - 1].trim() != '(') t.splice(i, 0, ','); if (!c) if (!o) o = true; else return; } diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sailors-coconuts-and-a-monkey-problem.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sailors-coconuts-and-a-monkey-problem.english.md index 1ecbb192ac..8df6da77fe 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sailors-coconuts-and-a-monkey-problem.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sailors-coconuts-and-a-monkey-problem.english.md @@ -77,13 +77,13 @@ challengeType: 5 ```yml tests: - text: splitCoconuts is a function. - testString: 'assert(typeof splitCoconuts === ''function'', ''splitCoconuts is a function.'');' + testString: 'assert(typeof splitCoconuts === "function", "splitCoconuts is a function.");' - text: splitCoconuts(5) should return 3121. - testString: 'assert(splitCoconuts(5) === 3121, ''splitCoconuts(5) should return 3121.'');' + testString: 'assert(splitCoconuts(5) === 3121, "splitCoconuts(5) should return 3121.");' - text: splitCoconuts(6) should return 233275. - testString: 'assert(splitCoconuts(6) === 233275, ''splitCoconuts(6) should return 233275.'');' + testString: 'assert(splitCoconuts(6) === 233275, "splitCoconuts(6) should return 233275.");' - text: splitCoconuts(7) should return 823537. - testString: 'assert(splitCoconuts(7) === 823537, ''splitCoconuts(7) should return 823537.'');' + testString: 'assert(splitCoconuts(7) === 823537, "splitCoconuts(7) should return 823537.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sedols.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sedols.english.md index 17481e02b0..04b12c8eb9 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sedols.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sedols.english.md @@ -9,7 +9,7 @@ challengeType: 5 Task:

- For each number list of 6-digit + For each number list of 6-digit SEDOLs, calculate and append the checksum digit.

@@ -51,15 +51,15 @@ challengeType: 5 ```yml tests: - text: sedol is a function. - testString: 'assert(typeof sedol === ''function'', ''sedol is a function.'');' + testString: 'assert(typeof sedol === "function", "sedol is a function.");' - text: sedol('a') should return null.") - testString: 'assert(sedol(''a'') === null, "sedol(''a'') should return null.");' + testString: 'assert(sedol("a") === null, "sedol("a") should return null.");' - text: sedol('710889') should return '7108899'.") - testString: 'assert(sedol(''710889'') === ''7108899'', "sedol(''710889'') should return ''7108899''.");' + testString: 'assert(sedol("710889") === "7108899", "sedol("710889") should return "7108899".");' - text: sedol('BOATER') should return null.") - testString: 'assert(sedol(''BOATER'') === null, "sedol(''BOATER'') should return null.");' + testString: 'assert(sedol("BOATER") === null, "sedol("BOATER") should return null.");' - text: sedol('228276') should return '2282765'.") - testString: 'assert(sedol(''228276'') === ''2282765'', "sedol(''228276'') should return ''2282765''.");' + testString: 'assert(sedol("228276") === "2282765", "sedol("228276") should return "2282765".");' ``` 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 d56e6ad035..12d800c2de 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 @@ -37,17 +37,17 @@ See also: ```yml tests: - text: taxicabNumbers is a function. - testString: 'assert(typeof taxicabNumbers === ''function'', ''taxicabNumbers is a function.'');' + testString: 'assert(typeof taxicabNumbers === "function", "taxicabNumbers is a function.");' - text: taxicabNumbers should return an array. - testString: 'assert(typeof taxicabNumbers(2) === ''object'', ''taxicabNumbers should return an array.'');' + testString: 'assert(typeof taxicabNumbers(2) === "object", "taxicabNumbers should return an array.");' - text: taxicabNumbers should return an array of numbers. - testString: 'assert(typeof taxicabNumbers(100)[0] === ''number'', ''taxicabNumbers should return an array of numbers.'');' + testString: 'assert(typeof taxicabNumbers(100)[0] === "number", "taxicabNumbers should return an array of numbers.");' - text: 'taxicabNumbers(4) must return [1729, 4104, 13832, 20683].' - testString: 'assert.deepEqual(taxicabNumbers(4), res4, ''taxicabNumbers(4) must return [1729, 4104, 13832, 20683].'');' + testString: 'assert.deepEqual(taxicabNumbers(4), res4, "taxicabNumbers(4) must return [1729, 4104, 13832, 20683].");' - text: 'taxicabNumbers(25) should return [1729, 4104, 13832, 20683, 32832, 39312, 40033, 46683, 64232, 65728, 110656, 110808, 134379, 149389, 165464, 171288, 195841, 216027, 216125, 262656, 314496, 320264, 327763, 373464, 402597]' - testString: 'assert.deepEqual(taxicabNumbers(25), res25, ''taxicabNumbers(25) should return [1729, 4104, 13832, 20683, 32832, 39312, 40033, 46683, 64232, 65728, 110656, 110808, 134379, 149389, 165464, 171288, 195841, 216027, 216125, 262656, 314496, 320264, 327763, 373464, 402597]'');' + testString: 'assert.deepEqual(taxicabNumbers(25), res25, "taxicabNumbers(25) should return [1729, 4104, 13832, 20683, 32832, 39312, 40033, 46683, 64232, 65728, 110656, 110808, 134379, 149389, 165464, 171288, 195841, 216027, 216125, 262656, 314496, 320264, 327763, 373464, 402597]");' - text: 'taxicabNumbers(39) resulting numbers from 20 - 29 should be [314496,320264,327763,373464,402597,439101,443889,513000,513856].' - testString: 'assert.deepEqual(taxicabNumbers(39).slice(20, 29), res39From20To29, ''taxicabNumbers(39) resulting numbers from 20 - 29 should be [314496,320264,327763,373464,402597,439101,443889,513000,513856].'');' + testString: 'assert.deepEqual(taxicabNumbers(39).slice(20, 29), res39From20To29, "taxicabNumbers(39) resulting numbers from 20 - 29 should be [314496,320264,327763,373464,402597,439101,443889,513000,513856].");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/tokenize-a-string-with-escaping.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/tokenize-a-string-with-escaping.english.md index fa316b202f..df633f16d5 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/tokenize-a-string-with-escaping.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/tokenize-a-string-with-escaping.english.md @@ -29,7 +29,7 @@ It should accept three input parameters: function should output the following array:

-  ['one|uno', '', 'three^^', 'four^|quatro', '']
+  ['one|uno', ", 'three^^', 'four^|quatro', "]
   
@@ -44,13 +44,13 @@ It should accept three input parameters: ```yml tests: - text: tokenize is a function. - testString: 'assert(typeof tokenize === ''function'', ''tokenize is a function.'');' + testString: 'assert(typeof tokenize === "function", "tokenize is a function.");' - text: tokenize should return an array. - testString: 'assert(typeof tokenize(''a'', ''b'', ''c'') === ''object'', ''tokenize should return an array.'');' - - text: 'tokenize(''one^|uno||three^^^^|four^^^|^cuatro|'', ''|'', ''^'') should return [''one|uno'', '''', ''three^^'', ''four^|cuatro'', '''']")' - testString: 'assert.deepEqual(tokenize(testStr1, ''|'', ''^''), res1, "tokenize(''one^|uno||three^^^^|four^^^|^cuatro|'', ''|'', ''^'') should return [''one|uno'', '''', ''three^^'', ''four^|cuatro'', '''']");' - - text: 'tokenize(''a@&bcd&ef&&@@hi'', ''&'', ''@'') should return [''a&bcd'', ''ef'', '''', ''@hi'']' - testString: 'assert.deepEqual(tokenize(testStr2, ''&'', ''@''), res2, ''tokenize("a@&bcd&ef&&@@hi", "&", "@") should return ["a&bcd", "ef", "", "@hi"]'');' + testString: 'assert(typeof tokenize("a", "b", "c") === "object", "tokenize should return an array.");' + - text: 'tokenize("one^|uno||three^^^^|four^^^|^cuatro|", "|", "^") should return ["one|uno", "", "three^^", "four^|cuatro", ""]")' + testString: 'assert.deepEqual(tokenize(testStr1, "|", "^"), res1, "tokenize("one^|uno||three^^^^|four^^^|^cuatro|", "|", "^") should return ["one|uno", "", "three^^", "four^|cuatro", ""]");' + - text: 'tokenize("a@&bcd&ef&&@@hi", "&", "@") should return ["a&bcd", "ef", "", "@hi"]' + testString: 'assert.deepEqual(tokenize(testStr2, "&", "@"), res2, "tokenize("a@&bcd&ef&&@@hi", "&", "@") should return ["a&bcd", "ef", "", "@hi"]");' ``` @@ -96,14 +96,14 @@ function tokenize(str, charDelim, charEsc) { return { esc: blnEscChar, - token: blnBreak ? '' : ( - a.token + (blnEscChar ? '' : x) + token: blnBreak ? " : ( + a.token + (blnEscChar ? " : x) ), list: a.list.concat(blnBreak ? a.token : []) }; }, { esc: false, - token: '', + token: ", list: [] }); diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/top-rank-per-group.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/top-rank-per-group.english.md index 8d6eafe95d..caf8ebb0b4 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/top-rank-per-group.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/top-rank-per-group.english.md @@ -53,19 +53,19 @@ one could rank the top-rated movie in each genre by calling ```yml tests: - text: topRankPerGroup is a function. - testString: 'assert(typeof topRankPerGroup === ''function'', ''topRankPerGroup is a function.'');' + testString: 'assert(typeof topRankPerGroup === "function", "topRankPerGroup is a function.");' - text: topRankPerGroup returns undefined on negative n values. - testString: 'assert(typeof topRankPerGroup(-1, []) === ''undefined'', ''topRankPerGroup returns undefined on negative n values.'');' + testString: 'assert(typeof topRankPerGroup(-1, []) === "undefined", "topRankPerGroup returns undefined on negative n values.");' - text: First department must be D050 - testString: 'assert.equal(res1[0][0].dept, ''D050'', ''First department must be D050'');' + testString: 'assert.equal(res1[0][0].dept, "D050", "First department must be D050");' - text: First department must be D050 - testString: 'assert.equal(res1[0][1].salary, 21900, ''First department must be D050'');' + testString: 'assert.equal(res1[0][1].salary, 21900, "First department must be D050");' - text: The last department must be D202 - testString: 'assert.equal(res1[3][3].dept, ''D202'', ''The last department must be D202'');' + testString: 'assert.equal(res1[3][3].dept, "D202", "The last department must be D202");' - text: 'topRankPerGroup(1, ...) must return only top ranking result per group.' - testString: 'assert.equal(res2[2].length, 1, ''topRankPerGroup(1, ...) must return only top ranking result per group.'');' + testString: 'assert.equal(res2[2].length, 1, "topRankPerGroup(1, ...) must return only top ranking result per group.");' - text: 'topRankPerGroup(1, ...) must return only top ranking result per group.' - testString: 'assert.equal(res3[2][1].name, ''Maze Runner'', ''topRankPerGroup(1, ...) must return only top ranking result per group.'');' + testString: 'assert.equal(res3[2][1].name, "Maze Runner", "topRankPerGroup(1, ...) must return only top ranking result per group.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/topological-sort.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/topological-sort.english.md index 02ff479f57..3b46325bb1 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/topological-sort.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/topological-sort.english.md @@ -7,12 +7,12 @@ challengeType: 5 ## Description

-Given a mapping between items, and items they depend on, a -topological sort orders +Given a mapping between items, and items they depend on, a +topological sort orders items so that no item precedes an item it depends upon.

-The compiling of a library in the +The compiling of a library in the VHDL language has the constraint that a library must be compiled after any library it depends on.

@@ -20,9 +20,9 @@ Task:

Write a function that will return a valid compile order of VHDL libraries from their dependencies.

- Assume library names are single words. + Assume library names are single words. Items mentioned as only dependents have no dependents of their own, but their order of compiling must be given. - Any self dependencies should be ignored. + Any self dependencies should be ignored. Any un-orderable dependencies should be ignored.

Use the following data as an example:

@@ -73,15 +73,15 @@ C.f.:
 ```yml
 tests:
   - text: topologicalSort is a function.
-    testString: 'assert(typeof topologicalSort === ''function'', ''topologicalSort is a function.'');'
+    testString: 'assert(typeof topologicalSort === "function", "topologicalSort is a function.");'
   - text: topologicalSort must return correct library order..
-    testString: 'assert.deepEqual(topologicalSort(libsSimple), [''bbb'', ''aaa''], ''topologicalSort must return correct library order..'');'
+    testString: 'assert.deepEqual(topologicalSort(libsSimple), ["bbb", "aaa"], "topologicalSort must return correct library order..");'
   - text: topologicalSort must return correct library order..
-    testString: 'assert.deepEqual(topologicalSort(libsVHDL), solutionVHDL, ''topologicalSort must return correct library order..'');'
+    testString: 'assert.deepEqual(topologicalSort(libsVHDL), solutionVHDL, "topologicalSort must return correct library order..");'
   - text: topologicalSort must return correct library order..
-    testString: 'assert.deepEqual(topologicalSort(libsCustom), solutionCustom, ''topologicalSort must return correct library order..'');'
+    testString: 'assert.deepEqual(topologicalSort(libsCustom), solutionCustom, "topologicalSort must return correct library order..");'
   - text: topologicalSort must ignore unorderable dependencies..
-    testString: 'assert.deepEqual(topologicalSort(libsUnorderable), solutionUnorderable, ''topologicalSort must ignore unorderable dependencies..'');'
+    testString: 'assert.deepEqual(topologicalSort(libsUnorderable), solutionUnorderable, "topologicalSort must ignore unorderable dependencies..");'
 
 ```
 
@@ -123,7 +123,7 @@ function topologicalSort(libs) {
   // and array of packages on which it depends.
   const D = libs
     .split('\n')
-    .map(e => e.split(' ').filter(ep => ep !== ''))
+    .map(e => e.split(' ').filter(ep => ep !== "))
     .reduce((p, c) =>
       p.set(c[0], c.filter((e, i) => (i > 0 && e !== c[0] ? e : null))), new Map());
   [].concat(...D.values()).forEach(e => {
diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/towers-of-hanoi.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/towers-of-hanoi.english.md
index a9561decc2..acc22be7c8 100644
--- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/towers-of-hanoi.english.md
+++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/towers-of-hanoi.english.md
@@ -30,15 +30,15 @@ disc from stack B to A.
 ```yml
 tests:
   - text: towerOfHanoi is a function.
-    testString: 'assert(typeof towerOfHanoi === ''function'', ''towerOfHanoi is a function.'');'
+    testString: 'assert(typeof towerOfHanoi === "function", "towerOfHanoi is a function.");'
   - text: 'towerOfHanoi(3, ...) should return 7 moves.'
-    testString: 'assert(res3.length === 7, ''towerOfHanoi(3, ...) should return 7 moves.'');'
-  - text: 'towerOfHanoi(3, ''A'', ''B'', ''C'') should return [[''A'',''B''],[''A'',''C''],[''B'',''C''],[''A'',''B''],[''C'',''A''],[''C'',''B''],[''A'',''B'']].")'
-    testString: 'assert.deepEqual(towerOfHanoi(3, ''A'', ''B'', ''C''), res3Moves, "towerOfHanoi(3, ''A'', ''B'', ''C'') should return [[''A'',''B''],[''A'',''C''],[''B'',''C''],[''A'',''B''],[''C'',''A''],[''C'',''B''],[''A'',''B'']].");'
+    testString: 'assert(res3.length === 7, "towerOfHanoi(3, ...) should return 7 moves.");'
+  - text: 'towerOfHanoi(3, "A", "B", "C") should return [["A","B"],["A","C"],["B","C"],["A","B"],["C","A"],["C","B"],["A","B"]].")'
+    testString: 'assert.deepEqual(towerOfHanoi(3, "A", "B", "C"), res3Moves, "towerOfHanoi(3, "A", "B", "C") should return [["A","B"],["A","C"],["B","C"],["A","B"],["C","A"],["C","B"],["A","B"]].");'
   - text: 'towerOfHanoi(5, "X", "Y", "Z") 10th move should be Y -> X.'
-    testString: 'assert.deepEqual(res5[9], [''Y'', ''X''], ''towerOfHanoi(5, "X", "Y", "Z") 10th move should be Y -> X.'');'
-  - text: 'towerOfHanoi(7, ''A'', ''B'', ''C'') first ten moves are [[''A'',''B''],[''A'',''C''],[''B'',''C''],[''A'',''B''],[''C'',''A''],[''C'',''B''],[''A'',''B''],[''A'',''C''],[''B'',''C''],[''B'',''A'']].")'
-    testString: 'assert.deepEqual(towerOfHanoi(7, ''A'', ''B'', ''C'').slice(0, 10), res7First10Moves, "towerOfHanoi(7, ''A'', ''B'', ''C'') first ten moves are [[''A'',''B''],[''A'',''C''],[''B'',''C''],[''A'',''B''],[''C'',''A''],[''C'',''B''],[''A'',''B''],[''A'',''C''],[''B'',''C''],[''B'',''A'']].");'
+    testString: 'assert.deepEqual(res5[9], ["Y", "X"], "towerOfHanoi(5, "X", "Y", "Z") 10th move should be Y -> X.");'
+  - text: 'towerOfHanoi(7, "A", "B", "C") first ten moves are [["A","B"],["A","C"],["B","C"],["A","B"],["C","A"],["C","B"],["A","B"],["A","C"],["B","C"],["B","A"]].")'
+    testString: 'assert.deepEqual(towerOfHanoi(7, "A", "B", "C").slice(0, 10), res7First10Moves, "towerOfHanoi(7, "A", "B", "C") first ten moves are [["A","B"],["A","C"],["B","C"],["A","B"],["C","A"],["C","B"],["A","B"],["A","C"],["B","C"],["B","A"]].");'
 
 ```
 
diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/vector-cross-product.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/vector-cross-product.english.md
index c6bf671670..865f5849ca 100644
--- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/vector-cross-product.english.md
+++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/vector-cross-product.english.md
@@ -28,11 +28,11 @@ invalid inputs (ie vectors of different lengths).
 ```yml
 tests:
   - text: dotProduct must be a function
-    testString: 'assert.equal(typeof crossProduct, ''function'', ''dotProduct must be a function'');'
+    testString: 'assert.equal(typeof crossProduct, "function", "dotProduct must be a function");'
   - text: dotProduct() must return null
-    testString: 'assert.equal(crossProduct(), null, ''dotProduct() must return null'');'
+    testString: 'assert.equal(crossProduct(), null, "dotProduct() must return null");'
   - text: 'crossProduct([1, 2, 3], [4, 5, 6]) must return [-3, 6, -3].'
-    testString: 'assert.deepEqual(res12, exp12, ''crossProduct([1, 2, 3], [4, 5, 6]) must return [-3, 6, -3].'');'
+    testString: 'assert.deepEqual(res12, exp12, "crossProduct([1, 2, 3], [4, 5, 6]) must return [-3, 6, -3].");'
 
 ```
 
diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/vector-dot-product.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/vector-dot-product.english.md
index 463e415fdc..f0c04639c5 100644
--- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/vector-dot-product.english.md
+++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/vector-dot-product.english.md
@@ -30,17 +30,17 @@ invalid inputs (ie vectors of different lengths).
 ```yml
 tests:
   - text: dotProduct must be a function
-    testString: 'assert.equal(typeof dotProduct, ''function'', ''dotProduct must be a function'');'
+    testString: 'assert.equal(typeof dotProduct, "function", "dotProduct must be a function");'
   - text: dotProduct() must return null
-    testString: 'assert.equal(dotProduct(), null, ''dotProduct() must return null'');'
+    testString: 'assert.equal(dotProduct(), null, "dotProduct() must return null");'
   - text: 'dotProduct([[1], [1]]) must return 1.'
-    testString: 'assert.equal(dotProduct([1], [1]), 1, ''dotProduct([[1], [1]]) must return 1.'');'
+    testString: 'assert.equal(dotProduct([1], [1]), 1, "dotProduct([[1], [1]]) must return 1.");'
   - text: 'dotProduct([[1], [1, 2]]) must return null.'
-    testString: 'assert.equal(dotProduct([1], [1, 2]), null, ''dotProduct([[1], [1, 2]]) must return null.'');'
+    testString: 'assert.equal(dotProduct([1], [1, 2]), null, "dotProduct([[1], [1, 2]]) must return null.");'
   - text: 'dotProduct([1, 3, -5], [4, -2, -1]) must return 3.'
-    testString: 'assert.equal(dotProduct([1, 3, -5], [4, -2, -1]), 3, ''dotProduct([1, 3, -5], [4, -2, -1]) must return 3.'');'
+    testString: 'assert.equal(dotProduct([1, 3, -5], [4, -2, -1]), 3, "dotProduct([1, 3, -5], [4, -2, -1]) must return 3.");'
   - text: dotProduct(...nVectors) should return 156000
-    testString: 'assert.equal(dotProduct([ 0, 1, 2, 3, 4 ], [ 0, 2, 4, 6, 8 ], [ 0, 3, 6, 9, 12 ], [ 0, 4, 8, 12, 16 ], [ 0, 5, 10, 15, 20 ]), 156000, ''dotProduct(...nVectors) should return 156000'');'
+    testString: 'assert.equal(dotProduct([ 0, 1, 2, 3, 4 ], [ 0, 2, 4, 6, 8 ], [ 0, 3, 6, 9, 12 ], [ 0, 4, 8, 12, 16 ], [ 0, 5, 10, 15, 20 ]), 156000, "dotProduct(...nVectors) should return 156000");'
 
 ```
 
diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/word-wrap.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/word-wrap.english.md
index 13a7d0cd10..3ca16ac304 100644
--- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/word-wrap.english.md
+++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/word-wrap.english.md
@@ -15,7 +15,7 @@ Example text:
 
 Wrap text using a more sophisticated algorithm such as the Knuth and Plass TeX algorithm.
 If your language provides this, you get easy extra credit,
-but you ''must reference documentation'' indicating that the algorithm
+but you "must reference documentation" indicating that the algorithm
 is something better than a simple minimimum length algorithm.
 

@@ -44,17 +44,17 @@ than a simple minimimum length algorithm. ```yml tests: - text: wrap must be a function. - testString: 'assert.equal(typeof wrap, ''function'', ''wrap must be a function.'');' + testString: 'assert.equal(typeof wrap, "function", "wrap must be a function.");' - text: wrap must return a string. - testString: 'assert.equal(typeof wrap(''abc'', 10), ''string'', ''wrap must return a string.'');' + testString: 'assert.equal(typeof wrap("abc", 10), "string", "wrap must return a string.");' - text: wrap(80) must return 4 lines. - testString: 'assert(wrapped80.split(''\n'').length === 4, ''wrap(80) must return 4 lines.'');' + testString: 'assert(wrapped80.split("\n").length === 4, "wrap(80) must return 4 lines.");' - text: Your wrap function should return our expected text - testString: 'assert.equal(wrapped80.split(''\n'')[0], firstRow80, ''Your wrap function should return our expected text'');' + testString: 'assert.equal(wrapped80.split("\n")[0], firstRow80, "Your wrap function should return our expected text");' - text: wrap(42) must return 7 lines. - testString: 'assert(wrapped42.split(''\n'').length === 7, ''wrap(42) must return 7 lines.'');' + testString: 'assert(wrapped42.split("\n").length === 7, "wrap(42) must return 7 lines.");' - text: Your wrap function should return our expected text - testString: 'assert.equal(wrapped42.split(''\n'')[0], firstRow42, ''Your wrap function should return our expected text'');' + testString: 'assert.equal(wrapped42.split("\n")[0], firstRow42, "Your wrap function should return our expected text");' ``` @@ -91,7 +91,7 @@ console.info('after the test'); ```js function wrap (text, limit) { - const noNewlines = text.replace('\n', ''); + const noNewlines = text.replace('\n', "); if (noNewlines.length > limit) { // find the last space within limit const edge = noNewlines.slice(0, limit).lastIndexOf(' '); 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 c69c68b1c2..8d75790914 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 @@ -7,16 +7,16 @@ challengeType: 5 ## Description

-In strict +In strict functional programming and -the lambda calculus, -functions (lambda expressions) don't have state and are only allowed to refer to arguments of enclosing functions. +the lambda calculus, +functions (lambda expressions) don't have state and are only allowed to refer to arguments of enclosing functions. This rules out the usual definition of a recursive function wherein a function is associated with the state of a variable and this variable's state is used in the body of the function.

The Y combinator is itself a stateless function that, when applied to another stateless function, returns a recursive version of the function. The Y combinator is -the simplest of the class of such functions, called +the simplest of the class of such functions, called fixed-point combinators.

Task: @@ -39,17 +39,17 @@ See also Jim Weirich: Adventures in Function ```yml tests: - text: Y must return a function - testString: 'assert.equal(typeof Y(f => n => n), ''function'', ''Y must return a function'');' + testString: 'assert.equal(typeof Y(f => n => n), "function", "Y must return a function");' - text: factorial(1) must return 1. - testString: 'assert.equal(factorial(1), 1, ''factorial(1) must return 1.'');' + testString: 'assert.equal(factorial(1), 1, "factorial(1) must return 1.");' - text: factorial(2) must return 2. - testString: 'assert.equal(factorial(2), 2, ''factorial(2) must return 2.'');' + testString: 'assert.equal(factorial(2), 2, "factorial(2) must return 2.");' - text: factorial(3) must return 6. - testString: 'assert.equal(factorial(3), 6, ''factorial(3) must return 6.'');' + testString: 'assert.equal(factorial(3), 6, "factorial(3) must return 6.");' - text: factorial(4) must return 24. - testString: 'assert.equal(factorial(4), 24, ''factorial(4) must return 24.'');' + testString: 'assert.equal(factorial(4), 24, "factorial(4) must return 24.");' - text: factorial(10) must return 3628800. - testString: 'assert.equal(factorial(10), 3628800, ''factorial(10) must return 3628800.'');' + testString: 'assert.equal(factorial(10), 3628800, "factorial(10) must return 3628800.");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/zeckendorf-number-representation.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/zeckendorf-number-representation.english.md index ff2ee9d1e2..bbd3c6b3b1 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/zeckendorf-number-representation.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/zeckendorf-number-representation.english.md @@ -24,7 +24,7 @@ dropped so that 11 decimal becomes 10100. 10100 is not the only way to make 11 from the Fibonacci numbers however 0*13 + 1*8 + 0*5 + 0*3 + 1*2 + 1*1 or 010011 would also represent decimal 11. For a true Zeckendorf number there is the added -restriction that ''no two consecutive Fibonacci numbers can be used'' +restriction that "no two consecutive Fibonacci numbers can be used" which leads to the former unique solution.

@@ -44,9 +44,9 @@ which leads to the former unique solution. ```yml tests: - text: zeckendorf must be function - testString: 'assert.equal(typeof zeckendorf, ''function'', ''zeckendorf must be function'');' + testString: 'assert.equal(typeof zeckendorf, "function", "zeckendorf must be function");' - text: Your zeckendorf function should return the correct answer - testString: 'assert.deepEqual(answer, solution20, ''Your zeckendorf function should return the correct answer'');' + testString: 'assert.deepEqual(answer, solution20, "Your zeckendorf function should return the correct answer");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/zhang-suen-thinning-algorithm.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/zhang-suen-thinning-algorithm.english.md index 23d1486ecd..8726f012e0 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/zhang-suen-thinning-algorithm.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/zhang-suen-thinning-algorithm.english.md @@ -73,8 +73,8 @@ All pixels are again tested and pixels satisfying all the following conditions a (0) The pixel is black and has eight neighbours (1) $2 <= B(P1) <= 6$ (2) $A(P1) = 1$ - (3) At least one of P2 and P4 and '''P8''' is white - (4) At least one of '''P2''' and P6 and P8 is white + (3) At least one of P2 and P4 and "'P8"' is white + (4) At least one of "'P2"' and P6 and P8 is white After iterating over the image and collecting all the pixels satisfying all step 2 conditions, all these condition satisfying pixels are again set to white. Iteration: If any pixels were set in this round of either step 1 or step 2 then all steps are repeated until no image pixels are so changed. @@ -95,13 +95,13 @@ Write a routine to perform Zhang-Suen thinning on an image matrix of ones and ze ```yml tests: - text: thinImage must be a function - testString: 'assert.equal(typeof thinImage, ''function'', ''thinImage must be a function'');' + testString: 'assert.equal(typeof thinImage, "function", "thinImage must be a function");' - text: thinImage must return an array - testString: 'assert(Array.isArray(result), ''thinImage must return an array'');' + testString: 'assert(Array.isArray(result), "thinImage must return an array");' - text: thinImage must return an array of strings - testString: 'assert.equal(typeof result[0], ''string'', ''thinImage must return an array of strings'');' + testString: 'assert.equal(typeof result[0], "string", "thinImage must return an array of strings");' - text: thinImage must return an array of strings - testString: 'assert.deepEqual(result, expected, ''thinImage must return an array of strings'');' + testString: 'assert.deepEqual(result, expected, "thinImage must return an array of strings");' ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/zig-zag-matrix.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/zig-zag-matrix.english.md index 63db86a870..17baf40a38 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/zig-zag-matrix.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/zig-zag-matrix.english.md @@ -6,11 +6,11 @@ challengeType: 5 ## Description

-A   ''zig-zag''   array is a square arrangement of the first   +A   "zig-zag"   array is a square arrangement of the first   $N^2$   integers,   where the numbers increase sequentially as you zig-zag along the array's   anti-diagonals. -For example, given   '''5''',   produce this array: +For example, given   "'5"',   produce this array:
  0  1  5  6 14
  2  4  7 13 15
@@ -33,17 +33,17 @@ corresponding matrix as two-dimensional array.
 ```yml
 tests:
   - text: ZigZagMatrix must be a function
-    testString: 'assert.equal(typeof ZigZagMatrix, ''function'', ''ZigZagMatrix must be a function'');'
+    testString: 'assert.equal(typeof ZigZagMatrix, "function", "ZigZagMatrix must be a function");'
   - text: ZigZagMatrix should return array
-    testString: 'assert.equal(typeof ZigZagMatrix(1), ''object'', ''ZigZagMatrix should return array'');'
+    testString: 'assert.equal(typeof ZigZagMatrix(1), "object", "ZigZagMatrix should return array");'
   - text: ZigZagMatrix should return an array of nestes arrays
-    testString: 'assert.equal(typeof ZigZagMatrix(1)[0], ''object'', ''ZigZagMatrix should return an array of nestes arrays'');'
+    testString: 'assert.equal(typeof ZigZagMatrix(1)[0], "object", "ZigZagMatrix should return an array of nestes arrays");'
   - text: 'ZigZagMatrix(1) should return [[0]]'
-    testString: 'assert.deepEqual(ZigZagMatrix(1), zm1, ''ZigZagMatrix(1) should return [[0]]'');'
+    testString: 'assert.deepEqual(ZigZagMatrix(1), zm1, "ZigZagMatrix(1) should return [[0]]");'
   - text: 'ZigZagMatrix(2) should return [[0, 1], [2, 3]]'
-    testString: 'assert.deepEqual(ZigZagMatrix(2), zm2, ''ZigZagMatrix(2) should return [[0, 1], [2, 3]]'');'
+    testString: 'assert.deepEqual(ZigZagMatrix(2), zm2, "ZigZagMatrix(2) should return [[0, 1], [2, 3]]");'
   - text: ZigZagMatrix(5) must return specified matrix
-    testString: 'assert.deepEqual(ZigZagMatrix(5), zm5, ''ZigZagMatrix(5) must return specified matrix'');'
+    testString: 'assert.deepEqual(ZigZagMatrix(5), zm5, "ZigZagMatrix(5) must return specified matrix");'
 
 ```