In case of equal length find length update length with minimum sum
elif ( dp [ 0 ] [ i ] == dp [ 0 ] [ j ] + 1 ) : NEW_LINE INDENT dp [ 1 ] [ i ] = min ( dp [ 1 ] [ i ] , dp [ 1 ] [ j ] + arr [ i ] ) NEW_LINE DEDENT maxm = 0 NEW_LINE subtractSum = 0 NEW_LINE