Now we have done processing with the last array lets find out what is the maximum sum possible
ans = 0 NEW_LINE for i in range ( 7 ) : NEW_LINE INDENT ans = max ( ans , dp [ 5 ] [ i ] ) NEW_LINE DEDENT return ans NEW_LINE