6 kyu
Kata 2019: Fibonacci Bus
37 of 115myjinxin2015
Loading description...
Mathematics
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 is required. updated in this fork
Approved
I am not sure I really understand what is going on here. SO the first example is test.assert_equals(calc(5,7,32,4),13): But if I do it by hand I am getting nowhere to +13??? Could someone help and explain me, where my mistake is?
I guess the problem is you don't know in the second step how many persons got on the bus, you assumed 0 and that's not the case, you should calculate it given the number of persons got off at the last station.
In the details it says:
"At the second station(station2), a certain number of passengers get on and the same number get off. There are still k passengers on the bus." So I know that 0 passengers got on the bus, since it is still k passengers on the bus.
No, you're wrong, because the same amount of people that got on got off, so it's wrong to assume it was 0. It affects the following steps, see:
Ahhhh, now I get it :D my bad. Thanks for the quick help
n <= 30
is really low. In my opinion, withmathematics
tag, a bruteforcish solution shouldn't pass test suite. Seems reasonable to raise this upper bound to10000
or100000
.Perhaps Python can do this, but JS can not suport such a large range. And the main point of this kata is how to calculate it(using basic mathematical method), not how to calculate it quickly(with performance requirement). So, I think, it's not an issue ;-)
?? - 10^10 passengers on a bus? Must be hard to get a seat!
Ah, seat? There is no seat in the bus ;-)
please, correct your description, it's a nightmare to follow what you're talking about...
Is that what you actually mean? (edit: yes it is...)
Sorry for that :] will correct it, but not now.
Corrected. Thanks to clever B4B ;-)