Skip to content

Commit

Permalink
이슈 #331에서 솔루션 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Nov 19, 2024
1 parent c1c6f76 commit b7f8ad9
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Programmers/짝수_홀수_개수.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#include <string>
#include <vector>

using namespace std;

vector<int> solution(vector<int> num_list) {
vector<int> answer(2, 0);
for (int n : num_list) {
if (n % 2 == 0) {
answer[0]++;
} else {
answer[1]++;
}
}

return answer;
}

0 comments on commit b7f8ad9

Please sign in to comment.