Fill the last row and column with 0 's
for i in range ( n ) : NEW_LINE INDENT final_array [ i ] [ n - 1 ] = final_array [ n - 1 ] [ i ] = 0 NEW_LINE DEDENT for i in range ( n ) : NEW_LINE INDENT t0 = final_array [ i ] [ i ] NEW_LINE t1 = final_array [ i ] [ n - 1 ] NEW_LINE DEDENT