You are given a binary array possible of length n.
Alice and Bob are playing a game consisting of n levels in order. Each level i is represented by possible[i]:
If possible[i] == 1, the player who plays level i gains
If possible[i] == 0, the player who plays level i loses
Alice plays first and completes a prefix of the levels. Bob then plays the remaining levels to the end. Both Alice and Bob must play at least
Return the minimum number of levels Alice must play to earn strictly more total points than Bob. If it is impossible for Alice to obtain more points than Bob, return
Constraints:
possible.length
possible[i] is either
You are given a binary array possible of length n.
Alice and Bob are playing a game consisting of n levels in order. Each level i is represented by possible[i]:
If possible[i] == 1, the player who plays level i gains
If possible[i] == 0, the player who plays level i loses
Alice plays first and completes a prefix of the levels. Bob then plays the remaining levels to the end. Both Alice and Bob must play at least
Return the minimum number of levels Alice must play to earn strictly more total points than Bob. If it is impossible for Alice to obtain more points than Bob, return
Constraints:
possible.length
possible[i] is either