Here is the link to the problem: Equal | HackerRank
1
3
1 5 5
Won’t the answer of this testcase be 4? The correct answer is 3 but how?
Here is the link to the problem: Equal | HackerRank
1
3
1 5 5
Won’t the answer of this testcase be 4? The correct answer is 3 but how?
First she chooses colleague 1 and gives 1 chocolate each to colleague 2 and 3.
So now it is 1 6 6.
Next she chooses colleague 2 and gives 5 chocolates to 1 and 3.Now it is :
6 6 11.
At last colleague 3 is chosen and 5 chocolates to 1 and 2 make it:
11 11 11.
Hence answer is 3.
Yeah, that’s it. Thanks