Skip to content

Commit e131395

Browse files
committed
Runtime: 10 ms (Top 67.59%) | Memory: 7.5 MB (Top 80.20%)
1 parent f1caa49 commit e131395

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Runtime: 10 ms (Top 67.59%) | Memory: 7.5 MB (Top 80.20%)
12
class Solution {
23
public:
34
string sortString(string s) {
@@ -9,20 +10,20 @@ class Solution {
910
string res ;
1011
while(res.size()!=s.size()){
1112
for(int i = 0 ;i<26;i++){
12-
if(count[i] >0) {
13+
if(count[i] >0) {
1314
char ch = i+'a';
1415
res += ch;
1516
count[i]--;
16-
}
17+
}
1718
}
1819
for(int i = 25 ;i>=0 ;i--){
1920
if(count[i] >0){
2021
char ch= i+'a';
2122
res += ch;
2223
count[i]--;
2324
}
24-
}
25+
}
2526
}
2627
return res ;
2728
}
28-
};
29+
};

0 commit comments

Comments
 (0)