Is approach incorrect


is this approach incorrect?

@akshatkaush
Yes it is wrong. Because while doing one operation you are considering only one element.
Let take a example:- 5, 9, 7, 11
after 1 operation elements are:- 6, 9, 7, 10
after 2 operation elements are:- 7, 9, 7, 9
after 1 operation elements are:- 8, 8, 8, 8

So try to think of a greedy approach, you can also refer to video lecture for this if you are facing difficulty.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.