Function to flip the minimum number of cells such that there doesn 't exists any such path from (0, 0) to (N - 1, M - 1) cell consisting of 0s
def solve ( ) : NEW_LINE INDENT global matrix NEW_LINE N = len ( matrix ) NEW_LINE M = len ( matrix [ 0 ] ) NEW_LINE DEDENT