Fill the dp [ ] for base case when all elements are selected from A [ ]
for i in range ( 1 , l1 + 1 ) : NEW_LINE INDENT dp [ i ] [ 0 ] = dp [ i - 1 ] [ 0 ] + A [ i - 1 ] NEW_LINE max_sum = max ( max_sum , dp [ i ] [ 0 ] ) NEW_LINE DEDENT