6 kyu
Avoid trillion years of calculations !!
122 of 129raulbc777
Loading description...
Performance
Algorithms
Mathematics
Machine Learning
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.
Excellent one!
I have two questions about permutation task as following:
So is it permutation task different to the math formular? is it the new definition by kata? If this permutation definted by kata, please let me know how [1,....,13] in test case got 67xxxxxxx. I don't need code but fomular please. Thanks.
Hi, @adazhu2802. You have to experiment with the code for different lengths of iterables, arrays or strings, and then, try to figure out the pattern of these results. If you introduce an iterable of length 1, the counter will be 0. That's an important hint to know that the value of the counter isn't simple as factorial(length). Have a good day!
I am new here. Please let me know how to submit my solution. Many thanks!
Press the (bottom-right) button labelled
Attempt
to run the Kata test cases.If your solution passes, the button label will change to
Submit Final
.Press it.
This comment has been hidden.
Thank you. I found it. My task bar hided it.
This comment has been hidden.
Upvoted solution. Clever +1.
Passed all tests before
30 to 50
cases, then failed all tests after.Passed all
up to 10 elements
cases so i guess i got the correct pattern, which is weird that results are slightly different because it's just integer calculation. So what could the problem be....Thanks ZED.CWT for your fast feedback. I found a division in my formula for the pattern. That's my mistake for the low precision that I have. I'll see if I can get the pattern in another way. If not I will drop the length of the iterables.
I'll unpublish it for a while for a better precision.
Could you try again in Python 2? I have another solution with sums and products only. After this I'll prepare it for Python 3
Seems good to me o_O