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.
My JavaScript solution has a time complexity of 2 * O(n log n), so effectively O(n log n). On my laptop it's finishing 100000 element arrays in around 118ms when reporting it with console.time. I am getting through around 70 large tests at this time complexity, should O(n log n) be a passing solution?
Update
I refactored my solution and brought down the time complexity down to just a single O (n log n) algorithm.
I cannot express enough how satifying it feels to finally complete this. This challenge provoked me to take an online course on data structures and algorithms. I have learned so much since I first attempted this challenge and stuck with it until I learned the proper data structure needed to complete it.
In the end I was clocking around 12ms for a 100000 element array on my local machine. Tho the real accomplishment was what I learned in the journey to get there.
Cheers and thanks for a great challenge!
He increments i everytime a test case is called
I don't understand this at all, won't it always just return true?
So i've solved this kata and learned a lot in the process. However the solutions have been withheld and it's saying I have not solved it.
How did you compress the string?
It's a known bug. https://github.com/Codewars/codewars.com/issues/311
On further thoughts, maybe the codewars servers are just struggling to update quick enough. Along side the horde's of coders using codewars.
So I've solve the Kata! However on submit I was sent to blocked solutions page. I'm wondering whats gone wrong here. Quite possible my solution just sucked horribly and did not deserve the on honor of seeing the solutions. Or is this a bug?
Disabled Node 10.x. Not having it natively should at least encourage more users to spend some time to learn the concept. We can retire JavaScript version in the future when we deprecate older Node versions. Hopefully, Codewars is in a better shape by then to handle this properly.
This comment is hidden because it contains spoiler information about the solution
I think javascript can be fine IF it does not have big numbers.
But yeah, lost cause.
Well, that's because the kata is a bad idea and should only be written in languages like C/C++. Just look at the translation page and how someone even tried to translate it to Python...
In any case, not my issue. If people want to shitpost translations regardless of whether the language fits the task, blame those people.
BigInt
is only available in Node 10.I've just enabled it.
This comment is hidden because it contains spoiler information about the solution