Doubt in approach

Does this question want the solution according to greedy approach?

Example:
Test case 1
4
1 2 3 4

Greedy Approach - Piyush picks 4, Namit picks 3, Piyush picks 2 , Namit picks 1
Sum with Piyush = 6

Other possible scenario - Piyush picks 4 , Namit picks 1, Piyush picks 3 , Namit picks 2
Sum with piyush = 7

the answer according to the question should be 6, which is only possible if following greedy approach

Test Case 2:
4
4 15 3 2

If we go for greedy approach here we will get the wrong answer.

What approach is to be followed?

Going for maximum number on each turn is Greedy Approach while aiming for a maximum total is the Optimal Approach. While the Greedy Approach might work for some testcases , it will not work for all of the them

Try this testcase :
4
2 3 7 4

Using the greedy technque ,
Player 1 picks 4
Player 2 picks 7
Player 1 picks 3
Player 2 picks 2

Player 1 Score = 4 + 3 = 7
Player 2 Score = 7 + 2 = 9

Since our goal was to make sure that Player 1 wins, the greedy technique fails

If we were not inclined to use the greedy technique and had played optimally like this
Player 1 picks 2 (Even though its lesser of 2 & 4)
Player 2 picks 4
Player 1 picks 7
Player 2 picks 3

Player 1 Score = 2 + 7 = 9
Player 2 Score = 4 + 3 = 7

Player 1 wins.
in this question both the players play optimically so inorder to maximise your result you have to minimise your opponents result and then chose the maximum of both the results .