* Fix mypy in #2684

* fix pre-commit
This commit is contained in:
John Law
2020-11-30 01:30:31 +08:00
committed by GitHub
parent 0febbd397e
commit 25164bb638
5 changed files with 34 additions and 22 deletions

View File

@ -1,4 +1,7 @@
def solve_maze(maze: [[int]]) -> bool:
from typing import List
def solve_maze(maze: List[List[int]]) -> bool:
"""
This method solves the "rat in maze" problem.
In this problem we have some n by n matrix, a start point and an end point.
@ -67,7 +70,7 @@ def solve_maze(maze: [[int]]) -> bool:
return solved
def run_maze(maze: [[int]], i: int, j: int, solutions: [[int]]) -> bool:
def run_maze(maze: List[List[int]], i: int, j: int, solutions: List[List[int]]) -> bool:
"""
This method is recursive starting from (i, j) and going in one of four directions:
up, down, left, right.
@ -106,6 +109,7 @@ def run_maze(maze: [[int]], i: int, j: int, solutions: [[int]]) -> bool:
solutions[i][j] = 0
return False
return False
if __name__ == "__main__":