5 kyu
Combinations in a Set Using Boxes
88 of 114raulbc777
Loading description...
Performance
Algorithms
Mathematics
Machine Learning
Combinatorics
Number Theory
Memoization
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.
Great kata to learn some math.
I'm troubled by the example. Why do we not consider configurations in which the (1) ball is not in the first box? (e.g. |(2)| |(1)(3)| |(4)|
It's time to learn math
Can anybody explain me, how we can get 7 combinations of putting 4 balls into 2 boxes?
Here's the seven ways:
Do you know answer why there is 7 combinations? And how can you find total combination for arbitrary n, k values?
I don't want to give away too much, but I think that you said it quite well above:
I certainly learned some math in order to solve this kata ;)
*As a small side hint: the ordering as I gave it above is the structure I used to find my first correct algorithm... unfortunately it wasn't fast enough and I had to go do research
thank you! I missed that balls are different :)
Julia translation
approved+1
Cheers!
cheers! :)
Haskell :https://www.codewars.com/kumite/5bbeb2639b84f4fd2e0002fb?sel=5bbeb2639b84f4fd2e0002fb
(hope this gets it out of beta)
Wish granted ;-)
Ok. Fixed. Let me know if things are working well.
o_O