5 kyu
How many Wagons Are in the Train?
115sgerodes
Loading description...
Algorithms
Puzzles
Lists
Linked Lists
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.
Amazing Kata, thx!
I don't understand how to count more than 250 wagons in 16s?
I do not understand what to do here. How does the train object look? Are the methods indicated already implemented?
How to bypass Timed Out Exit Code: 1? I dont know how to optimize my code.
You need to.
Sorry. I have not checked the case when train without light. My while is looped.
howManyWagons
should bestatic
.If the tests will be changed to call the function statically, all the current solutions will be invalidated for no good reason, so there is no reason to make the function in the initial solution static if it will not actually be called statically.
the kata is in beta, existing solutions can be invalidated any time.Okay, so the kata left beta before i noticed. But still, no amount of solutions should be an excuse for having a kata with issues, and quality should be a top priority.
13 solutions, come on... the kata will get many more valid solutions in a short time...
Alright then, fixed :)
Protected members can be accessed by all files in the same package, leading to near-trivial solutions like this one.
fixed.
"Solutions" like this should be prevented.
Should be fixed. valid solutions will pass in a few seconds while invalid ones will timeout.
Nice kata. Since this is a puzzle kata, you should forbid the use of reflection: https://www.codewars.com/kata/reviews/5df7aef74225f30001d3a38b/groups/61544f4eced5470001aa1032 Unfortunately I have no idea how to do this properly without breaking the test runner.
If you really want to block something, you could check out
restrictedApisTest
in this translation, or this kumite.fixed.
Awesome kata, thanks!
Please add sample tests.
added
Kata changed to avoid cheating Solutions