Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
The reference solution is correct BTW. I brute forced it in https://www.codewars.com/kumite/670be7418cec2e9e1c4ea945
and you should, this is a 4 kyu after all
ofc, you can change the tests if that's needed.
That's not intended but I guess I can't do anything with it 😂
My solution is faster than that, so I guess I can further raise
n
or make timer stricter.But probably not after this kata being approved.
I figured out what the issue was (to do with large negative number arithmetic) and have fixed it and submitted my final correct solution. Removal of the incorrect one would be appreciated if possible.
If there's a way of removing the solution it shouldn't stay because it isn't a correct solution. As I mentioned, it fails about 5% of the time. It's also unfinalised and has multiple things I would tidy up before properly submitting.
Your solution will stay. Those solutions were not intended.
This comment is hidden because it contains spoiler information about the solution
You should probably specify the input range, like, how big the string can be.
I don't want to start trying to come up with a fancy solution if brute force works.
oops, I .slice() in the wrong way
"0" is not a valid input. It's not positive.
Fixed
Fixed.
One coercion won't change that time complexity much ( at worst, to
O(log W)
, but that's still practically instantaneous ).That would also not be the solution everyone is going to submit. If it's even correct.citation needed
Loading more items...