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.
Large interval tests are added to all languages.
it's actually enough to perform checks only until the square root of n
Yes; maybe this should be a "follow up" version (like Advent of Code)
Better use Set to store valid faces
omg that's great!
This comment is hidden because it contains spoiler information about the solution
Maybe add some simple test cases for big numbers to filter out performance heavy solutions?
e.g.
too much comments. You don't need most of them. They just clutter the code.
Why is it considered best practice? I would downvote if I could:
(https://en.wikipedia.org/wiki/Prime_gap)
toArray()[0]
you can usefindFirst()
This comment is hidden because it contains spoiler information about the solution
I don't like side effects of filter function. To get number of zeros you can just subtract lengths of both arrays:
arr.length - withoutZeros.length
Please see my solution for reference