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.
It's hard to explain something when it seem pretty clear to you, maybe with some examples you'll get it too:
Consecutive numbers:
1 and 2, 2 and 3, 3 and 4, etc.
Not consecutive:
1 and 3, 2 and 4, 3 and 5, etc.
By not consecutive we mean not exactly 1 larger than the previous element of the array.
What does this statement mean?
The first non-consecutive number is 7. Not a kata issue.
Exactly
Testing for first_non_consecutive([5, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45])
Here as well, there seems an issue.
let: Array name is arr
arr[1]-arr[0] = 2
So, when difference becomes other than 2, the non-consective number is next number.
arr[2]-arr[1] = 1, so first non-consecutive number should be 8, not 7