10 lines
242 B
Python
10 lines
242 B
Python
|
def pgsp(lst:list):
|
||
|
n = len(lst)
|
||
|
somme_max = lst[0]
|
||
|
for i in range(n):
|
||
|
for j in range(i, n):
|
||
|
s = somme_sous_sequence(lst, i, j)
|
||
|
if s > somme_max :
|
||
|
somme_max = s
|
||
|
return somme_max
|