func minimumLevels(possible []int) int { n := len(possible) alice := 0 bob := 0 for i := 0; i < n; i++ { if possible[i] == 0 { bob-- } else { bob++ } } for i := 0; i < n-1; i++ { if possible[i] == 0 { bob++ alice-- } else { bob-- alice++ } if alice > bob { return i + 1 } } return -1 }