Company: unify apps
Difficulty: medium
Predict the Winner Two players alternately take one integer from either end of an array. Player 1 moves first. Both play optimally. Return whether Player 1 can finish with a score at least as large as Player 2's score. Input Format The first line contains `n`. The second line contains `n` integers. Output Format Print `true` if Player 1 can win or tie; otherwise print `false`. Example Input: `3` then `1 5 2` Output: `false` Constraints `1 ≤ n ≤ 2000`; each value fits in a signed 32-bit integer.