๐ก ์์์ ํ๋์ฉ ๋ํ๋ค๊ฐ n ๋ณด๋ค ์ปค์ง๋ ๊ฐ์ด ์๊ธฐ๋ ์๊ฐ๊น์ง ๋ํ๋ ํฉ์ ๋ฆฌํดํ๋ผ
class Solution {
public int solution(int[] numbers, int n) {
int answer = 0;
for (int i = 0 ; i < numbers.length; i++){
if (answer <= n){
answer += numbers[i];
}
}
return answer;
}
}