func solution(_ win_lose: [Int]) -> Int {
var winLose = win_lose
var intArray = [[Int]]()
var resultArray = [Int]()
var result = Int()
while winLose.count != 0 {
var firstZeroIndex = Int()
var temp = [Int]()
if let zeroIndex = winLose.firstIndex(of: 0) {
firstZeroIndex = zeroIndex
}
for i in 0...firstZeroIndex {
temp.append(winLose[i])
}
intArray.append(temp)
for _ in 0...firstZeroIndex {
winLose.removeFirst()
}
}
for i in 0..<intArray.count {
resultArray.append(intArray[i].reduce(0) { $0 + $1 })
}
if let tempResult = resultArray.max() {
result = tempResult
}
return result
}