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.
This fork runs about 500ms faster, on average
Rust translation. Please review and approve
Note that by simply using a string to represent the previous character seen and filtering after sorting, we skip having to re-check the entire output slice (or string) repeatedly to determine if we're looking at a duplicate.
I think this is likely to be the fastest possible solution, since it runs in constant time.
I was inspired by another solution to refactor mine for readability
Oh, I agree that my answer is wrong (though I've yet to track down why), but it should be simple enough to explicitly cast the number to a string.
I'm working on the Python version of this Kata and there seems to be an error the way the tests are printing errors (?)
Here's what I keep getting:
By parallelizing the calculations into chunks of 50 numbers, we get massive speedups for longer ranges. Every run of this is under 200ms for all tests, even in bad random test scenarios, despite the String operations including regex and the Arrays.sort call required to get the output properly formatted.
Recursive algorithm running ansynchronously. Finished all tests in ~540 ms.