+ 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?
3 Respuestas
+ 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
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?
0
But i need the code :-/