you give integer array num two player play game array player 1 player 2player 1 player 2 turn player 1 start both player start game score 0 at turn player take number end array ie nums0 numsnumslength 1 reduce size array 1 the player add choose number score the game end element arrayreturn true Player 1 win game if score player equal player 1 winner return true you assume player play optimally Example 1input num 152output falseexplanation Initially player 1 choose 1 2 if choose 2 1 player 2 choose 1 2 5 if player 2 choose 5 player 1 leave 1 2 so final score player 1 1 2 3 player 2 5 hence player 1 winner need return falseexample 2input num 152337output trueExplanation Player 1 choose 1 then player 2 choose 5 7 no matter number player 2 choose player 1 choose 233finally player 1 score 234 player 2 12 need return true represent player1 win Constraints1 numslength 200 numsi 107