6 kyu
Simple Fun #140: Circle Slash
248 of 531myjinxin2015
Loading description...
Puzzles
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.
JS fork 🤖🤖
mocha/chai
assertions + ´lodash´ for randomnessMerged.
that was fun
python new test framework is required. updated in this fork
Approved
I feel like this problem should be split into a easy version that can be brute-forced and this version, which cannot. At least it should be stated more clearly that brute force simulations of the process will not pass the tests.
I have a solution, optimized the best I can, but it's timing out on the final test where n = (A MASSIVE NUMBER). How are we supposed to calculate successfully a solution for n being so large?
I have checked multiple solutions online for this problem, and none of them can pass the final test for huge n values like n=597144599. Please fix this, every solution times out!
You need to search harder. The problem is perfectly solvable without timing out.
What is the trick? I've optimized it a ton, even used linked lists - seems like a bad kata if a dozen perfectly good solutions fail because 'oh you didn't use the special trick' or something.
It's not a perfectly good solution if it doesn't meet the performance requirements.
Maybe we should add a
performance
tag.Perf tag is a good idea, though I'm not sure it will dissuade comments like this.
@Transfixed you need to use more maths, try looking for a pattern.
This comment has been hidden.
Scala translation
Should all be fine, but it might be good to check I didn't make the performance requirements too harsh vs other languages.
Approved
Ruby translation should be updated 3.0, see relevent information here: https://github.com/codewars/content-issues/wiki/List-of-Ruby-Kata-to-Update
Enabled in this fork + tests cleanup + description formatting fix
I have passed all of the sample tests, but when i want to attempt my solution, i am getting 'Response received but no data was written to STDOUT or STDERR'. (python)
How can i fix it?
It should be a question, instead of an issue. I think error message is reported by browser, not CW testing frameworks. I think the best way is to try again ;-) Issue closed.
Brute force - failed Very fast brute force - failed Memoization - failed Finally o(n) - passed 3 hours of coding.
This comment has been hidden.
It is, but here simple brute force does not pass.
"Suppose there are n people standing in a circle and they are numbered 1 through n in order. Person 1 starts off with a sword and kills person 2."
That escalated very quickly :o
They hated each other with passion.
Lol :) I guess so!
All 50 tests pass but I keep getting this error...
'each': failed to allocate memory (NoMemoryError)
It seems that you are using a brute force solution. there are more than 100 testcases in Ruby version.
This comment has been hidden.
1 <= n <= 1e9
Do you think your code can create an array of 1000000000 elements and operate multiple times? What you need is to derive a formula to solve the problem, rather than brute force ;-)
This comment has been hidden.
This comment has been hidden.
PHP Translation Kumited - please accept :D
Approved. Thanks ;-)
This comment has been hidden.
This comment has been hidden.
clever solution ;-)