The point of the kata is to find all noncontiguous numbers that sum within a range. Your answer includes numbers that are next to each other in the provided array/list.
EG: [-3, -1, 1, 4, 6]; -3, -1, 4, and 6 are next to each other.
Yes, but 6 and 7 are incorrect, because the next correct number after 1 is 2, which doesn't appear. Therefore, all that comes after 1 is missplaced and should be included in the returned list. I changed the description to "Incorrect page numbers may appear next to each other".
From the description:
"The sequence will always be 10 numbers long and we know that the base is going to be between 2 and 10 inclusive"
"When sorted, the sequence is made up of consecutive numbers."
Ten consecutive numbers always contain all available digits in bases < 10
OP solved it, closing
This comment is hidden because it contains spoiler information about the solution
The point of the kata is to find all noncontiguous numbers that sum within a range. Your answer includes numbers that are next to each other in the provided array/list.
EG: [-3, -1, 1, 4, 6]; -3, -1, 4, and 6 are next to each other.
intresting
Of course, but it doesn't have to add 1 ... twice every time 😉
Yes, but
6
and7
are incorrect, because the next correct number after1
is2
, which doesn't appear. Therefore, all that comes after1
is missplaced and should be included in the returned list. I changed the description to "Incorrect page numbers may appear next to each other".The recursion stops when the parameter becomes 0. It is falsy so will return 0, then rollback :)
Love this one, so simple
Duplicate issue of
no sample tests
belowFrom the description:
"The sequence will always be 10 numbers long and we know that the base is going to be between 2 and 10 inclusive"
"When sorted, the sequence is made up of consecutive numbers."
Ten consecutive numbers always contain all available digits in bases < 10
Absolutely, an ES6 awesome resolve😱, even you can skip the index parameter(i) and just put underscore(_) in place 😁👍
Language?
Done. If you (not "you", but the other reader ;o ) still have troubles, make sure you're using 3.8
Loading more items...