Otherwise , update the current state to the minimum of the next state and state including the current element A [ i ]
else : NEW_LINE INDENT dp [ i ] [ j ] = min ( dp [ i + 1 ] [ j ] , dp [ i + 1 ] [ j - A [ i ] ] + A [ i ] ) NEW_LINE DEDENT