+ 1

Can anyone provide the code to solve this problem?

There are n numbers of apple in a basket... 5 friends guessed the n as (22, 24, 29, 33, 38) The guess were off by (1, 8, 6, 3, 8) in random order.. Find the number of apples?

9th Aug 2016, 4:07 PM
Ahmed Shafeeu
Ahmed Shafeeu - avatar
3 Answers
+ 2
Is just working out with max and min. For each guess, you have to both add and subtract a number from the "off by" array. And find the combination where you get the same number all the time. That number is the number of apples. Hope that can help
9th Aug 2016, 6:45 PM
André Policarpo
0
The answers 30 apples, but I don't feel like coding it out, maybe you can use that to come up with your own program?
9th Aug 2016, 4:11 PM
James
James - avatar
0
But i need the code :-/
9th Aug 2016, 5:31 PM
Ahmed Shafeeu
Ahmed Shafeeu - avatar