Coin game player one wins

Write codeMedium30 min

Your task

Players alternate taking a coin from either end of the array coins; player one moves first. Return True if player one can end with a total >= player two's total under optimal play by both (ties count as a win for player one). 1 <= len(coins) <= 200, 0 <= coins[i] <= 10^6.

Examples

first_player_can_tie(coins: list[int]) -> bool
Example 1
Inputfirst_player_can_tie([1, 5, 2])
OutputFalse