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.
i believe it works due to fact that value of arr[:i+1] is not being called as ending value is not included in a slice of list.
Example:
arr = [1,2,3,4,5]
len(arr) = 5
[i for i in range(5)] --> i = [0,1,2,3,4]
len(arr) --> IndexError
arr[:i] -> arr[:4] --> [1,2,3,4]
arr[:i+1] -> arr[:5] --> [1,2,3,4,5]