From 8bc8f8c8745d39e7d36362f8b7ef45f43a11e462 Mon Sep 17 00:00:00 2001 From: shashank Date: Sun, 1 Oct 2023 07:13:58 +0530 Subject: [PATCH] Update rat_in_maze.py Fixes #9066 Backtracking/Rat Maze #9066 I have made updates to the rat_in_maze.py file to resolve the bug to create expected output by returning (solutions,1) as tuple --- backtracking/rat_in_maze.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backtracking/rat_in_maze.py b/backtracking/rat_in_maze.py index 7bde886dd558..b82df5b93fe2 100644 --- a/backtracking/rat_in_maze.py +++ b/backtracking/rat_in_maze.py @@ -64,7 +64,7 @@ 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!") return solved