sir,why my code is failing all the test cases.
they have asked the maximum profit that piyush can make if both of them take alternate terms.
then according to me ,piyush would win maximum profit,if we sort the array and piyush takes the coin from the end while the other guy from the beginning.and so in this way piyush only gets the maximum value coins.
or tell me if i have interpreted the question wrongly!