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.
Did you bench it. It looks that hashset is not required or is slower that this solution. Probable because L3 cache
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
please use the spoiler flag when posting anything related to the solution
This comment is hidden because it contains spoiler information about the solution
thanks
This comment is hidden because it contains spoiler information about the solution
It feels like cheating 😂
What's the time complexity of this solution?
Which part of "There's binary search solution" did you just miss? :P
This comment is hidden because it contains spoiler information about the solution
Sorry, but which part of "adhoc method" did you just miss? :P
If you solve it with algorithm this is a binary search problem with O(log n) solution. Considering sum of cubes must not exceed unsigned 64 bit integer, answer is found in 17 steps at worst case.
This answer is O(n) solution. Worst case scenario is at roughly 92682 steps. Are you calling it clever?
You can either solve this problem with math formula or using adhoc method.
For math formula, you can see solution of g964, which is the most clever.
My solution is for adhoc method.
And since raw loop is hard to follow, so code without raw loop is better practices, hence the votes here.
Morse code table as JSON
Loading more items...