From 032a1c34ae7ed90efa58eaac6d4bb012a7265494 Mon Sep 17 00:00:00 2001 From: Aung Myo Kyaw Date: Fri, 27 Oct 2017 09:08:49 +0630 Subject: [PATCH] feat(euler-problem): Add test and solution for problem 7 (#15988) --- .../project-euler-problems.json | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/seed/challenges/08-coding-interview-questions-and-take-home-assignments/project-euler-problems.json b/seed/challenges/08-coding-interview-questions-and-take-home-assignments/project-euler-problems.json index 937977c30e..1781d29fc6 100644 --- a/seed/challenges/08-coding-interview-questions-and-take-home-assignments/project-euler-problems.json +++ b/seed/challenges/08-coding-interview-questions-and-take-home-assignments/project-euler-problems.json @@ -171,17 +171,23 @@ "type": "bonfire", "title": "Problem 7: 10001st prime", "tests": [ - "assert.strictEqual(euler7(), 104743, 'message: euler7() should return 104743.');" + "assert.strictEqual(nthPrime(6), 13, 'message: nthPrime(6) should return 13.');", + "assert.strictEqual(nthPrime(10), 29, 'message: nthPrime(10) should return 29.');", + "assert.strictEqual(nthPrime(100), 541, 'message: nthPrime(100) should return 541.');", + "assert.strictEqual(nthPrime(1000), 7919, 'message: nthPrime(1000) should return 7919.');", + "assert.strictEqual(nthPrime(10001), 104743, 'message: nthPrime(10001) should return 104743.');" + ], + "solutions": [ + "const nthPrime = (number)=>{\n let pN = 2;\n let step = 0;\n while (step