In this example, the function should return -1 because it never reaches the goal node. It goes from start --> right corner --> start --> left corner in a loop.
Anyone have a solution?