Optimimum Strategy to maximise coins to collect from either ends

i am unable to think dynamic approach to this question.
this is the standard question in geek for geeks.please tell me how to proceed to dynamic approach

@SOHAN
there is already a video lecture provided on 0-1 Knapsack in the course, go and watch it first.
It is for recursive solution, so for apply DP you can just apply memoization technique on that.

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.