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.
Hilarious
How so? Integer multiplication and division by two are internally realized using bit shifts:
Which of these is better? (In my own experiments, I found only a negligible speed difference < 1%)
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Well, I see lots of
rng.nextInt
in the test case generator function... Where is your assertion based upon?You wrote "i < 99999" -- note that 99999 is a perfectly valid pin ;-)
Why the ^ and the spaces in your RegExp?
Beautifully compact code, but please note that you compute the same product nums.length times... Better precompute it in the way of javier-elizaga.
Not the most concise option (like those nifty regexes), but certainly best practice for both readability and performance. Good job!