I wonder if the true difficulty for any rated difficulty level tends to drift over the years. I.e. this puzzle is from several years ago; maybe 2kyu was appropriate difficulty ranking when it was written but is no longer so.
Assuming the author of this is Kata is also the author of the test cases, it's unlikely that the test case "should return 2 for input 1" is not as he intended. More likely he did not communicate his intentions clearly in the Kata instructions. I have added a comment to this Kata's discussion recommending that the author update and improve the instructions.
I intentionally wrote the code this way, that it behave as it behave.
I think the test case "should return 2 for input 1" is wrong.
When limit is 1, 2 exceeds the limit, so it should not be taken into account.
Ok, the instruction says "Generate all of the Fibonacci numbers starting with 1 and 2 and ending on the highest number before exceeding the parameter's value", but this looks a bit like, change the instruction that it fits the code, I would expect:
Expect(SumEvenFibonacci(0)).To(Equal(0))
Expect(SumEvenFibonacci(1)).To(Equal(0))
Expect(SumEvenFibonacci(5)).To(Equal(2)) (interessting case, some of the codes here return 2, some 10)
Well don't I feel silly!! XD
lol
i feel you
How are the difficulty values set?
I wonder if the true difficulty for any rated difficulty level tends to drift over the years. I.e. this puzzle is from several years ago; maybe 2kyu was appropriate difficulty ranking when it was written but is no longer so.
Reminds me of that old version of Tetris where you would slowly reveal a nude picture of a lady
This comment is hidden because it contains spoiler information about the solution
I think you can train again and submit a new solution that overwrites your previous one.
Not sure I would have ever thought of this!
+1
Ah yeah I see it more clearly now, thanks :)
Interesting to see that the solution of ldfritz works because he adds a to the sum instead of b
Assuming the author of this is Kata is also the author of the test cases, it's unlikely that the test case "should return 2 for input 1" is not as he intended. More likely he did not communicate his intentions clearly in the Kata instructions. I have added a comment to this Kata's discussion recommending that the author update and improve the instructions.
I intentionally wrote the code this way, that it behave as it behave.
I think the test case "should return 2 for input 1" is wrong.
When limit is 1, 2 exceeds the limit, so it should not be taken into account.
Ok, the instruction says "Generate all of the Fibonacci numbers starting with 1 and 2 and ending on the highest number before exceeding the parameter's value", but this looks a bit like, change the instruction that it fits the code, I would expect:
Expect(SumEvenFibonacci(0)).To(Equal(0))
Expect(SumEvenFibonacci(1)).To(Equal(0))
Expect(SumEvenFibonacci(5)).To(Equal(2)) (interessting case, some of the codes here return 2, some 10)
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Thank you for your feedback. I learned something new in response
This comment is hidden because it contains spoiler information about the solution