We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Think about two cars: C(current) and R(result). They have the same speed and C is in fromt of R. The distance between them is the value of positionFromTail. So when C arrive at the ending point, where is R? Note that their distance is "positionFromTail", the position of R is the position from tail.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Get Node Value
You are viewing a single comment's thread. Return to all comments →
Think about two cars: C(current) and R(result). They have the same speed and C is in fromt of R. The distance between them is the value of positionFromTail. So when C arrive at the ending point, where is R? Note that their distance is "positionFromTail", the position of R is the position from tail.