




def       UpperCAmelCase__  (     lowerCamelCase,			lowerCamelCase,			lowerCamelCase,			lowerCamelCase   ):
  lowercase	,    lowercase    :List[Any]      	=						len(lowerCamelCase   ), len(grid[0]   )
  if (
      min(lowerCamelCase,			lowerCamelCase   ) < 0
      or row == row_length
      or col == col_length
      or (row, col) in visit
      or grid[row][col] == 1
  ):
    return 0
  if row == row_length - 1 and col == col_length - 1:
    return 1

  visit.add((row, col)   )

  lowercase    :Union[str, Any]      	=						0
  count += depth_first_search(lowerCamelCase,			row + 1,			lowerCamelCase,			lowerCamelCase   )
  count += depth_first_search(lowerCamelCase,			row - 1,			lowerCamelCase,			lowerCamelCase   )
  count += depth_first_search(lowerCamelCase,			lowerCamelCase,			col + 1,			lowerCamelCase   )
  count += depth_first_search(lowerCamelCase,			lowerCamelCase,			col - 1,			lowerCamelCase   )

  visit.remove((row, col)   )
  return count


if __name__ == "__main__":
     import doctest

     doctest.testmod()









def       UpperCAmelCase__  (     lowerCamelCase,			lowerCamelCase   ):
  return int((input_a, input_a).count(0   ) != 0   )



def       UpperCAmelCase__  (     ):
  assert nand_gate(0,			0   ) == 1
  assert nand_gate(0,			1   ) == 1
  assert nand_gate(1,			0   ) == 1
  assert nand_gate(1,			1   ) == 0


if __name__ == "__main__":
     print(nand_gate(0, 0))
     print(nand_gate(0, 1))
     print(nand_gate(1, 0))
     print(nand_gate(1, 1))



