7 kyu
Recursion #2 - Fibonacci
3,113gabrielsiedler
Loading description...
Fundamentals
Recursion
Mathematics
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.
This could have had a more descriptive prompt. Please leave an example of expected input and output.
Is that all or we have a third part? Kinda start loving it =)
This comment has been hidden.
This comment has been hidden.
This comment has been hidden.
Either call yourself twice, or use
function
syntax. Tests want to see"fibonacci"
twice. ( Yes, anti-cheat is hard to do well. )This comment has been hidden.
Hey, I didn't know you can style the description page with HTML & CSS. Nice trick you did there.
This comment has been hidden.
Isn't that similar to what LesRamer mentioned 6 years ago?
Yes, true ... but I would like to know: why is this called an anti-cheat? It is recursion, isn't it? I do have more to learn about optimization and tail/non-tail, but I guess I would've hoped that a
7kyu
kata that asksDo you know recursion?
and instructsYou have to use recursion
would at least mention the difference if the only way you will be learning about an anti-cheat is when you're first tested for it.Can't help you there, it seems that part is testing there are two and not only one recursive call to the function, at least that's what I see.
In that case, this is possible, for what it's worth.
Hasoipj
Pyhon translation has been provided.
Please review and approve.
Rust translation has been provided.
Please review and approve.
Hi, little issue with the kata. When I attempt my function, it passes all the test. But I doesn't display the "Submit" button... Any idea?
Currently Codewars platform is experiencing issues.
https://github.com/Codewars/codewars.com/issues/893
This comment has been hidden.
It is because it's using the ES2015 fat arrow syntax. If you converted it the old
function fibonacci
syntax you will pass the test. This is misleading because the code template originally has the fat arrow syntax.Cool Kata, this is the very first time I have used recursion :)
Congrats man. You've gone from never use recursion to being a 1 Dan Warrior :)
This comment has been hidden.
TIL BabelJS optimizes tail recursion. This filters out some solutions, though.
This comment has been hidden.
hence my strong recomendation for this anticheat implementation.
You should definitely state that one should never actually use the recursive variant. It's fine for learning recursion, but the runtime is exceptional (should I say exponential?) bad.
Easily cheatable, but honestly I don't think it's an issue because everyone can see the solution which is why I'm not marking this as an issue. I do suggest however changing the anticheat to catch this stuff. :) Other than that, good kata :)
Mind elaborate how is it easy to cheat?
Nice series :)