Idea
For this question, I think it's really simple firstly. But actually, it have a lots detail to note. I just modify the previosu program to solve this question, when I finished and submit, I get out of Money, it's terrible!
After consider and reading others' blogs, I find what the question want is to find the shortest path, if u want to use BFS, even thought u find it, but it don't present the shortest. Because what the question care about is the number of turning around rathan than step. So I want to traversal all the point again and again to find the shortest. But it doesn't work, finally, I find that if we traversal whole row or colum every step, then we use BFS, we can find the shortest path.
In conclusion, if we want the shortest path, we can use BFS, but I should make it clear what's the step.