Stores if a position in the matrix been visited or not
vis = [ ] NEW_LINE for i in range ( M + 5 ) : NEW_LINE INDENT vis . append ( [ ] ) NEW_LINE for j in range ( N + 5 ) : NEW_LINE INDENT vis [ i ] . append ( False ) NEW_LINE DEDENT DEDENT