diff --git a/challenges/08-coding-interview-questions-and-take-home-assignments/project-euler-problems.json b/challenges/08-coding-interview-questions-and-take-home-assignments/project-euler-problems.json index f24e8661b1..32a296f68c 100644 --- a/challenges/08-coding-interview-questions-and-take-home-assignments/project-euler-problems.json +++ b/challenges/08-coding-interview-questions-and-take-home-assignments/project-euler-problems.json @@ -693,21 +693,24 @@ "type": "bonfire", "title": "Problem 15: Lattice paths", "tests": [ - "assert.strictEqual(euler15(), 137846528820, 'message: euler15() should return 137846528820.');" + "assert.strictEqual(latticePaths(4), 70, 'message: latticePaths(4) should return 70.');", + "assert.strictEqual(latticePaths(9), 48620, 'message: latticePaths(9) should return 48620.');", + "assert.strictEqual(latticePaths(20), 137846528820, 'message: latticePaths(20) should return 137846528820.');" ], - "solutions": [], + "solutions": ["function latticePaths(gridSize) {\n let paths = 1;\n\n for (let i = 0; i < gridSize; i++) {\n paths *= (2 * gridSize) - i;\n paths /= i + 1;\n }\n return paths;\n}"], "translations": {}, "challengeSeed": [ - "function euler15() {", + "function latticePaths(gridSize) {", " // Good luck!", " return true;", "}", "", - "euler15();" + "latticePaths(4);" ], "description": [ "Starting in the top left corner of a 2×2 grid, and only being able to move to the right and down, there are exactly 6 routes to the bottom right corner.", "", + "\"a", "", "How many such routes are there through a 20×20 grid?" ]