Question : Is it possible to solve this problem.

Hi Experts,

Three people (A, B & C) between them have 774 apples.

A + B = 562
B + C = 408
A + C = 578

How many apples do each of the people have?

Answer : Is it possible to solve this problem.

Using the code in the related post, consider what happens when adjacent_find sends left=(22,A) and right=(22,A) to isDistEqual(). The distances match, but the student ID do not match and so
       left.studentName != right.studentName
is false. So this pair is skipped by adjacent_find.

So, you won't even know from adjacent_find that there even were two entries = (22,A). So, you don't have to worry about getting 22 feet: A, A, C, D since 22,A will be seen only once.
Random Solutions  
 
programming4us programming4us