Skip to content

Commit

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

using namespace std;

int solution(int i, int j, int k) {
int answer = 0;
for (int idx = i; idx <= j; idx++) {
for (char c : to_string(idx)) {
if (c - '0' == k) {
answer++;
}
}
}

return answer;
}

0 comments on commit 6ac3836

Please sign in to comment.