Educative

Is there an explanation on why this works?

Why does moving pointer2 by ‘k’ make pointer1 & pointer2 meet at the cycle start point

Here is how you understand it. Let’s say that A is going at 5 mph speed and B is going at 8 mph speed. The difference in speed is 3 mph. If A and B are running in a cycle then B will keep meeting A after every Circle/3 time.

Similarly, if one pointer is moving faster than other then ultimately, faster pointer will catch up with the slow one.

1 Like