Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """
- Carlos A Delgado S
- Suma más larga
- """
- def index_largest_sum(a):
- n = len(a)
- ini = 0
- fin = 0
- maxi = float("-inf")
- for i in range(n):
- suma = 0
- for j in range(i,n):
- suma+=a[j]
- if suma>maxi:
- maxi = suma
- x = i
- y = j
- return x,y
- print(index_largest_sum([-1,9,0,8,-5,6,-24]))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement