From 0259580b863c364f62270c630ba07c072dee1365 Mon Sep 17 00:00:00 2001 From: shashank Date: Sun, 1 Oct 2023 07:25:21 +0530 Subject: [PATCH 1/2] Update rat_in_maze.py Fixes #9066 I have resolved the bug by returning tuple as output --- backtracking/rat_in_maze.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backtracking/rat_in_maze.py b/backtracking/rat_in_maze.py index 7bde886dd558..c03364924537 100644 --- a/backtracking/rat_in_maze.py +++ b/backtracking/rat_in_maze.py @@ -64,9 +64,9 @@ def solve_maze(maze: list[list[int]]) -> bool: solutions = [[0 for _ in range(size)] for _ in range(size)] solved = run_maze(maze, 0, 0, solutions) if solved: - print("\n".join(str(row) for row in solutions)) + print((solutions,1)) else: - print("No solution exists!") + print(([],0)) return solved From be50a6ce8177211a411ef289242e13ab0124c2c4 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 1 Oct 2023 01:57:04 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- backtracking/rat_in_maze.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backtracking/rat_in_maze.py b/backtracking/rat_in_maze.py index c03364924537..a7aad683a704 100644 --- a/backtracking/rat_in_maze.py +++ b/backtracking/rat_in_maze.py @@ -64,9 +64,9 @@ def solve_maze(maze: list[list[int]]) -> bool: solutions = [[0 for _ in range(size)] for _ in range(size)] solved = run_maze(maze, 0, 0, solutions) if solved: - print((solutions,1)) + print((solutions, 1)) else: - print(([],0)) + print(([], 0)) return solved