Pls Explain Second Example


  • 0
    S

    The problem statement says that => " If the ball cannot reach the hole, output "impossible". But In the second example ball can reach the hole with "uld" path.


  • 2

    "The ball can go through empty spaces by rolling up (u), down (d), left (l) or right (r), but it won't stop rolling until hitting a wall. When the ball stops, it could choose the next direction."

    So in the second example, the ball won't stop until it rolls to row 0.


  • 0
    S

    thank you very much (y) now i understood


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.