





def 				lowerCAmelCase_ (							A_    ,A_    ,A_    ,A_):
    UpperCamelCase__				, UpperCamelCase__:	int					=     len(A_), len(grid[0])
    if (
        min(A_    ,A_) < 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))

    UpperCamelCase__:	Tuple					=     0
    count += depth_first_search(A_    ,row + 1    ,A_    ,A_)
    count += depth_first_search(A_    ,row - 1    ,A_    ,A_)
    count += depth_first_search(A_    ,A_    ,col + 1    ,A_)
    count += depth_first_search(A_    ,A_    ,col - 1    ,A_)

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


if __name__ == "__main__":
   import doctest

   doctest.testmod()








from __future__ import annotations

A__:    List[Any]  	=	10



def 				lowerCAmelCase_ (							A_):
    UpperCamelCase__:	Tuple					=     1
    UpperCamelCase__:	str					=     max(A_)
    while placement <= max_digit:
        # declare and initialize empty buckets
        UpperCamelCase__:	list[list]					=     [[] for _ in range(A_)]
        # split list_of_ints between the buckets
        for i in list_of_ints:
            UpperCamelCase__:	Union[str, Any]					=     int((i / placement) % RADIX)
            buckets[tmp].append(A_)
        # put each buckets' contents into list_of_ints
        UpperCamelCase__:	Union[str, Any]					=     0
        for b in range(A_):
            for i in buckets[b]:
                UpperCamelCase__:	Any					=     i
                a += 1
        # move to next
        placement *= RADIX
    return list_of_ints


if __name__ == "__main__":
   import doctest

   doctest.testmod()

