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.
A clarification would still be appreciated. For example, in test case find_all(35, 6), 107999 would be valid even though there is a zero after the one. Zeros that are not the first digit do count in the value of the number.
Thats redundant since 0 would never be greater than it's predecessor digit. And since 0 can not be the first digit, as 0's in front don't modify the actual value of a number, any 0 to the right would never satisfy the incrementing condition.
Today there are better ways to clone an array than via
JSON
. You can choose from[...arr]
,arr.slice()
,_.clone(arr)
for shallow copies, or_.cloneDeep(arr)
for deep copies.There are a few approaches I've seen. You definitely need to call your function first. One method I've seen is to call both functions with
JSON.parse(JSON.stringify(s))
, this will create a copy of the input for both function calls.s
is mutable (it's an array afterall). That means they clear the array before your tests are ever called.