84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
光阴似箭催人老,日月如移越少年。
After a cursory glance, j and k both start from 0, so [j-1][k] and [j][k-1] will fail
[j-1][k]
[j][k-1]
Try using a queue, breadth-first traversal, there are obviously some problems with using a for loop, for example, if you take m=1, you don’t look at the code carefully...
After a cursory glance, j and k both start from 0, so
[j-1][k]
and[j][k-1]
will failTry using a queue, breadth-first traversal, there are obviously some problems with using a for loop, for example, if you take m=1, you don’t look at the code carefully...