Predict the Winner

You are given an integer array nums. Players 1 and 2 take turns, with Player 1 starting first.

On each turn, a player removes either the first or the last element from the array and adds it to their score. The game ends when the array is empty.

Assuming both players play optimally, return true if Player 1 can win (score >= Player 2's score), otherwise return false.

Examples
Input: [1,5,2]
Output: false
Hints
Related Problems

Predict the Winner

You are given an integer array `nums`. Players 1 and 2 take turns, with Player 1 starting first.