I have a 2D array that is N * 4
Respectively [ x, y, visited , top_down] if 1 then top else down.
I want to get the shortest path between all the points with t