6 kyu
Imperfect Fibonacci Rabbits
48 of 75ChristianECooper
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.
Python new test framework should be used (Refer this for more detail)
done
The description is confusing. It is not clear what is the expected result and I suspect most of people will spend most of time trying to figure out not how to implement it, but what should they do. I did it by trial and error.
There should be annotation like: Return the number of ADULT PAIRS of rabbits at the BEGINNING of the mth month.
Ruby 3.0 should be enabled.
Enabled in this fork
Random tests in JS use values in exccess of the safe integer. I'm not sure it's a good idea.
fixed
Hey, I'm kinda stuck...
Could you give an full example for
imperfectFibonacciRabbits(8, 3, 4)
(especially month 4 and 5) ?When do the rabbits die? Before or after they multiply?
The rabbits die at the start of the month, they do not get to multiply after they have died! :)
This comment has been hidden.
... and I finally solved it after hours of trying. Sometimes you really can't see the forest for the trees...
Nice kata anyway. Thank you. :-)
Which language are you using?
Java.
Fixed and fixed. :)
Translation into both JS and Ruby submitted; I am not sure if you created this kata yourself starting from the base one or if it is some sort of classic problem that I didn't knew, but in the latter case, thanks for letting me know about it; in the former, kudos for your creativity :)
Oh, as usual: I would gladly add the random test cases (and one extra edge case just to round them all up to 50) in Python, just let me know if it is ok with you :)
Both approved, and feel free to add random tests to the Python code. I'm just coding up the Java translation now. :)
Done :)
This comment has been hidden.
Looks like there was an issue with my solution, please try again, and let me know if your answer still diverges from the given solution.
This comment has been hidden.
Your answer is right!
The final answer you are expected to send back is the number of rabbits at the start of month 6 not the end of month 6! :)
This confused me on the first rabbit kata too, I've mad a minor change to the description that hopefully clarifies the issue.
Hmm, ok, I would recommend to replace "n is the number of the month to end the simulation on" with something like "n is the number of month, at the begininning of which the simulation should stop.
This comment has been hidden.
Trying to follow the confusing numbering for the first one has caused this kata to have problems.
So I have rewritten the kata to follow a more clear numbering convention, i.e. we run to the end of the supplied month. I have also rewritten my solution without all the tweaks to follow the old numbering, aaaaaaand your answer is right. :)
I'm going to guess there was a bug in my previous solution.
Try running your solution again and see what happens. :)
Cool, thanks!