It will be used for storing start and end location in the same index
index = - 1 NEW_LINE for i in range ( 0 , size_of_array ) : NEW_LINE INDENT for j in range ( 0 , len ( a [ 0 ] ) ) : NEW_LINE INDENT if a [ i ] [ j ] == 0 : NEW_LINE DEDENT DEDENT