Skip to content

Commit bf08b73

Browse files
Merge pull request #1696 from CodingTestStudy2/염혜정
[염혜정] Day23
2 parents 4302561 + a7cac83 commit bf08b73

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// 0 ~ 9
2+
// O(log n)
3+
4+
class Solution {
5+
public int digitFrequencyScore(int n) {
6+
int result = 0;
7+
while (n>0) {
8+
int digit = n % 10;
9+
result += digit;
10+
n /= 10;
11+
}
12+
return result;
13+
}
14+
}

0 commit comments

Comments
 (0)