6 kyu
Children and candies
320 of 629myjinxin2015
Loading description...
Puzzles
Fundamentals
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.
Why don't you consider the idea of returning a tuple(multiple returns from a function) instead of a mandatory list, which in my opinion is more practical? -Python
python new test frameworks
Approved
Funny kata, congratulations, well done.
Very original! Thanks.
Nice kata! If possible, please add an edge case test where all children start with the same number of candies and there are at least two children. One of my solutions is actually wrong and I bet there are others, too. ;-)
Thank you for your feedback ;-) Added these fixed testcases:
Happy coding
^_^
@theropodMusings, Please check your Java translation ;-)
"randomTests" always return error with message <[[0], X]> but was:<[[1], X]> where X have different values, eg. expected:<[[0], 14]> but was:<[[1], 14]> Language Java
Are you sure that your result is right? Please give me the input data, thanks ;-)
Sample test works OK. "2, 15, 8, 14, 7, 2, 3, 11, 7, 19, 6, 16, 15, 19, 19, 5, 5, 17, 4, 5, 5, 12, 13, 1, 17, 4, 5, 11, 3, 4, 5, 11, 5, 3, 13, 15, 11, 19, 17, 16, 5, 4, 6, 5, 12, 17, 15, 3, 17, 6, 4, 7, 10, 5, 8, 5, 9, 2, 17, 13, 13, 19, 1, 14, 18, 15, 4, 4, 1, 14, 9, 1, 8, 16, 17, 13, 13, 16, 9, 12, 13, 2, 10, 14, 16, 15, 18, 17, 2, 16, 16, 9, 14, 3, 8, 12" it's one of test. It return "expected:<[[0], 12]> but was:<[[1], 12]>" In my local environment response is "78, 20"
@myjinxin2015 Hi, any clue why isn't working?
Ah, sorry. I haven't seen your reply :( It seems that you are using JAVA? I copied this testcase to the fix test, it returns {78,20} I think the JAVA translation mey contains errors, but I don't know JAVA. Let me try, or waiting for @theropodMusings to check it. Thanks for your feedback ;-)
Can you paste your code here and mark it as having spoiler content?
Hmm.. I have write a Java solution and submit it. It seems no error in the tests. Made some changes in the random tests:
Some possible problem in your code(just guess):
Thanks, edge case :) No it work
Python Tests fail if
math
not imported in solution template.Added
import math
in the testcode. Hope the issue fixed ;-)Problem solved. Can you remove
import math
also from preloaded template? So you can consider this issue as resolved!Removed(from initial code, not preload).
Nice kata, biggest challenge for me so far :) Thanks!
A wild Python appeared!
Approved ;-)
One random issue appeared too
A java kumite for your javascript :smile:
Approved. Thanks ;-) Next time, please don't mark your comment as
spoiler
. Beause I can not got a notice from CW if you do that ;-)Noted, nice kata btw.