Acc to this approach,
If we take the size of chopsticks as 1,2,3,4,5,6,7,8,9 and suppose the difference is supposed to be 3 at all times.
So when 1 will get paired with 4 then we take the pointer to i+3. But won’t that lead to skipping of the numbers 2 and 3 in between 1 and 4?
Chopstick problem
Hey @anindya-gupta
A pair of sticks can be used to eat as long as the difference in their length is at most D
So in above 1 2 will be paired and we take pointer to 3