



The first line contains a single integer ‘T’ denoting the number of test cases. The test cases follow.
The first line of each test case contains a single integer ‘N’ denoting the number of rows and columns in the given matrix.
Next ‘N’ lines contain ‘N’ single space-separated integers each denoting the elements in the matrix.
For each test case, print all paths from (0,0) to (N-1, N-1) separated by a single space.
The output of every test case will be printed in a separate line.
You don’t need to print anything; It has already been taken care of.
1 <= T <= 5
1 <= N <= 5
0 <= ARR[i][j] <= 1
Where ‘T’ denotes the number of test cases, ‘N’ denotes the number of rows and columns of the given matrix, and ARR[i] denotes the value of the cell (i,j) in the given matrix.
Time Limit: 1 sec
The idea is to use recursion to try all possible paths and include the paths in our answer through which we can reach the cell (N-1, N-1).
The steps are as follows:
Sorted Doubly Linked List to Balanced BST
Longest Substring with K-Repeating Characters
Expression Add Operators
Gray Code Transformation
Count of Subsequences with Given Sum