Can someone explain this question? (REDCGAME)

Edit: edited the solution to give optimum sum

10 5
3 3 3 4 5 7 8 9 43 76

Reduce (7,43) as far as possible

3 3 3 4 5 5 8 9 41 76

Next Reduce (8, 41)

3 3 3 4 5 5 5 9 38 76

Next Reduce (9, 38)

3 3 3 4 5 5 5 5 34 76

Finally Reduce (34, 76)

3 3 3 4 5 5 5 5 5 47

No more reductions possible.
Final sum is 85.

But AC code gives 85

1 Like

Corrected it
#20 chars

Thanks everyone! Got it!:slightly_smiling_face:

That “parity check” and “else” takes care of case 2

1 Like

I didn’t understand your code,but the choices for the paires could be random because in the questions he said if you do multiple choice, but then he want the maximum sum for farest decrement you could have in the given array?!

1 Like