mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-05 17:34:49 +08:00
clean of unnecessary checks, imports, calls (#7993)
This commit is contained in:
@ -88,12 +88,12 @@ def run_maze(maze: list[list[int]], i: int, j: int, solutions: list[list[int]])
|
||||
solutions[i][j] = 1
|
||||
return True
|
||||
|
||||
lower_flag = (not (i < 0)) and (not (j < 0)) # Check lower bounds
|
||||
lower_flag = (not i < 0) and (not j < 0) # Check lower bounds
|
||||
upper_flag = (i < size) and (j < size) # Check upper bounds
|
||||
|
||||
if lower_flag and upper_flag:
|
||||
# check for already visited and block points.
|
||||
block_flag = (not (solutions[i][j])) and (not (maze[i][j]))
|
||||
block_flag = (not solutions[i][j]) and (not maze[i][j])
|
||||
if block_flag:
|
||||
# check visited
|
||||
solutions[i][j] = 1
|
||||
|
Reference in New Issue
Block a user