6 kyu
SumFibs
585 of 1,299benschac
Loading description...
Algorithms
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
Nice Kata
Really enjoyable challenge of the series, good job.
C++ translation (author inactive). This is my first C++ translation so please review carefully.
C Translation kumited (author inactive).
Thanks :)
COBOL translation with random tests (author gone).
approuvé
In JS version, in Test_2, expected result is 44 but it should be 10.
Problem is difference between instructions and tests Instruction → INDEX in the Fibonacci sequence → Exemple 1, n=5, [0,1,1,2,3,5] Tests → Arrray.length → Test 1, n=5, [0,1,1,2,3]
In the description there is an example 9 -> 44 In the js tests there is a test 9 -> 44 How is that different? It's exactly the same. Maybe your code is off by one.
Pay attention, my friend, on last element of test2 array. There is diffrence. In instructions is "5", but in Tests is "3", becouse length of arrays is diffrent. In instructions parameter "n" presents maximum INDEX of fib. Array, and on Tests "n" presents maximum length of array.
I've tested my code in console, and it works as expected, but when it's pasted in codewars, error pops up. That's how error is spoted.
No random tests in JS version
Julia translation
Python translation kumited :) please review and approve ~~
Ruby translation kumited :) please review and approve ~~
Approved.
Whoever approved this should've ensured it had random tests.
As stated by others, I would clarify about lower indexes expecting to trigger undefined results; plus, I would consider 0 an even number.
That said, it would need also random test cases and much larger test ranges. Let me know if I might help in that regard :)
0 is considered a even number, and there are no undefined result anywhere, not sure what you are talking about. Also summing up empty array should be 0 anyway.
See the discussion below, again from one year ago...
Hey, nice Kata. Might be worth putting in your description that if there are no even fibonacci return
undefined
.Or for clarity (and good practice for handling errors) get the function to return something like
"no even fibonacci numbers found"
Up to you whether you want to change the error message, but would update the description for when no even numbers.
Since the upper bound is inclusive, there can't be no even number (in the proper logical sense of double negative). So I think it should expect 0 for 0 (and for 1 and 2).
Unnamed is right, the expected value for n∈[0,2] should be 0, since 0 is considered as an even number AFAIK.
I agree with Unnamed, I'll update the Kata now. That totally makes sense because there would be a number there. It just wouldn't be > 1.
Watch your spacing in the description. Codewars supports Github markdown so you can make your descriptions clearer by wrapping your example code in ```s.
sweeeeeet, I'll update this with some markdown magic.
Danke!