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.
Java translation
Haskell translation
Current input range of the kata is too small.
10^6
entries can be easily enumerated inside the time constraint by enumerating in binary, and there is only 1 fixed test with input10^7
. The only acceptable performance here isO(log n)
here if performance is required (implied to be so, otherwise the10^7
input is unnecessary).Besides, most current solutions don't work when the result is past
Number.MAX_SAFE_INTEGER
(and this is really a JS only thing), so either way the input should be pushed higher (BigInt
will be useful for this).Input range should be specified for a performance kata.
I hate to say this, be please don't give false performance "tips" in description, especially if you cannot up with a solution with satisfactory performance (one could even argue that you probably should seek assistance before creating said kata). There are many more submitted solutions that are both much better and do not require such assumptions.
This is not mentioned anywhere, and the fact that logging to console is prohibited is ridiculous.
Random testcases added for JavaScript - the tests were already completely parametrised anyway.
PHP tests could use an overhaul in the same way.
You have some undocumented specs there:
array
type