iterating over last i . e ( m - 1 ) th column and connecting Node .
elif j == m and i < n - 1 : NEW_LINE INDENT i = i + 1 NEW_LINE temp . bottom = Node ( grid [ i ] [ j - 1 ] ) NEW_LINE temp = temp . bottom NEW_LINE DEDENT