我要翻译的内容如下:
为什么不能使用动态规划来解决?我们不能存储从给定单元格开始的所有路径字符串吗? 问题链接
我要谈论的问题如下:
Consider a rat placed at (0, 0) in a square matrix m[ ][ ] of order n and has to reach the destination at (n-1, n-1).
The task is to find a sorted array of strings denoting all the possible directions which the rat can take to reach the destination at (n-1, n-1).
The directions in which the rat can move are ‘U'(up), ‘D'(down), ‘L’ (left), ‘R’ (right).
You cannot visit an already visited cell.
Examples:
Input : N = 4
1 0 0 0
1 1 0 1
0 1 0 0
0 1 1 1
Output :
DRDDRR
Input :N = 4
1 0 0 0
1 1 0 1
1 1 0 0
0 1 1 1
Output :
DDRDRR DRDDRR
为什么不能使用动态规划来解决?我们不能存储从给定单元格开始的所有路径字符串吗? 问题链接