2 parents 4302561 + a7cac83 commit bf08b73Copy full SHA for bf08b73
1 file changed
leetcode3/염혜정/3945. Digit Frequency Score.java
@@ -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