What is wrong with this approach
hello @garganshul151
a) u r trying greedy approach. (in this problem greedy fails)
b) u cannot sort the array , because players are allowed to pick elements only from the corners.
why greedy is not applicable to this?
both player are playing optimally.
so both will try to maximize their score.
whereas in greedy u will try to maximize ur own score without considering opponent