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.
If the sequence is any contiguous subset, an empty subset would be valid and have a sum of 0.
If all numbers are negative the maximum sum is the largest number, not 0
Can anyone point to some mathematical sources on how this works exactly?
Says who? This is a perfectly functional soulution. No need to impose arbitrary limitations on ourselves
No, because we are checking the length of the initial s variable, not the output variable which always has the length of at least 1 due to the beginning "#" char.