from typing import List
def solution(numbers: List[int], n: int) -> int:
answer = 0
for num in numbers:
answer += num
if answer > n :
break
return answer
func solution(numbers []int, n int) int {
result := 0
for num := 0; num <= len(numbers); num ++ {
result += numbers[num]
if result > n {
break
}
}
return result
}