웅재의 코딩세상

[프로그래머스] 없는 숫자 더하기 본문

코딩테스트/프로그래머스 - LV 1

[프로그래머스] 없는 숫자 더하기

웅드 2024. 2. 9. 17:01

 

  • 풀이
#include <string>
#include <vector>
#include <algorithm>

using namespace std;

int solution(vector<int> numbers) {
    int answer = 45;
    for(int i=0; i<numbers.size(); i++){
        answer -= numbers[i];
    }
    return answer;
}
반응형