From 7aa0b7be6f50340cc2ef17ac36d8f63bfe6da4db Mon Sep 17 00:00:00 2001 From: Yashkumar Gupta <50690622+yashh1234@users.noreply.github.com> Date: Wed, 30 Nov 2022 18:12:45 +0530 Subject: [PATCH] chore(CPlusPlus): add rat in a maze problem (#1051) Co-authored-by: Arsenic <54987647+Arsenic-ATG@users.noreply.github.com> --- .../Backtracking/rat-in-a-maze-problem.cpp | 60 +++++++++++++++++++ algorithms/CPlusPlus/README.md | 1 + 2 files changed, 61 insertions(+) create mode 100644 algorithms/CPlusPlus/Backtracking/rat-in-a-maze-problem.cpp diff --git a/algorithms/CPlusPlus/Backtracking/rat-in-a-maze-problem.cpp b/algorithms/CPlusPlus/Backtracking/rat-in-a-maze-problem.cpp new file mode 100644 index 00000000..0be8f73e --- /dev/null +++ b/algorithms/CPlusPlus/Backtracking/rat-in-a-maze-problem.cpp @@ -0,0 +1,60 @@ +#include +using namespace std; + +bool issafe(int** arr, int x, int y, int n){ + if(x>n; + int** arr=new int*[n]; + for(int i=0; i>arr[i][j]; + } + } + int** solArr=new int*[n]; + for(int i=0; i