Strategy right or not?

I am in doubt whether at each turn, if first coin is big, he removes that, if last coin is bigger, he removes that. Is this optimum? Am I right in thinking this way?

Nop Rishabh. Though i would encourage you to try it out…and then improvise it further.

@rishabhsetiya7
Please provide code of the approach that you are thinking,will together optimise it futher.

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.