Oct-30-2021, 06:43 AM
I ran several tests with both proposed codes, up to len(arr) = 100,
and I get the same results.
So for what it's worth:
and I get the same results.
So for what it's worth:
maxArr = [max(arr)] for number in range(len(arr)): for grouping in range(2,len(arr)-number+1): maxArr.append(sum(arr[number:(number+grouping)])) print(max(maxArr))Paul
It is more important to do the right thing, than to do the thing right.(P.Drucker)
Better is the enemy of good. (Montesquieu) = French version for 'kiss'.
Better is the enemy of good. (Montesquieu) = French version for 'kiss'.