Skip to content

Commit 29a2018

Browse files
committed
Runtime: 93 ms (Top 57.79%) | Memory: 12.6 MB (Top 53.41%)
1 parent 1bcb917 commit 29a2018

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

scripts/algorithms/S/Sort Integers by The Power Value/Sort Integers by The Power Value.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
// Runtime: 93 ms (Top 57.79%) | Memory: 12.6 MB (Top 53.41%)
12
class Solution {
23
public:
34
int getPower(int num) {
45
if (num == 1)
56
return 0;
6-
7+
78
int res = 0;
89
if (num %2 == 0)
910
res += getPower(num/2);
@@ -12,7 +13,7 @@ class Solution {
1213
res++;
1314
return res;
1415
}
15-
16+
1617
int getKth(int lo, int hi, int k) {
1718
multimap<int,int> um;
1819
for (int i = lo; i <= hi; i++) {
@@ -28,4 +29,4 @@ class Solution {
2829
}
2930
return res;
3031
}
31-
};
32+
};

0 commit comments

Comments
 (0)