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 think the clever thing of this solution is that you will only iterate arr to do the sum once. In the current top solution you iterate over it and do the sum len(arr) times making it O(n^2). Also, by using enumerate instead of range(len(arr)) you are already getting the element of the list to add it or substract it from the variables currently containing the sums.