We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f1caa49 commit e131395Copy full SHA for e131395
scripts/algorithms/I/Increasing Decreasing String/Increasing Decreasing String.cpp
@@ -1,3 +1,4 @@
1
+// Runtime: 10 ms (Top 67.59%) | Memory: 7.5 MB (Top 80.20%)
2
class Solution {
3
public:
4
string sortString(string s) {
@@ -9,20 +10,20 @@ class Solution {
9
10
string res ;
11
while(res.size()!=s.size()){
12
for(int i = 0 ;i<26;i++){
- if(count[i] >0) {
13
+ if(count[i] >0) {
14
char ch = i+'a';
15
res += ch;
16
count[i]--;
- }
17
+ }
18
}
19
for(int i = 25 ;i>=0 ;i--){
20
if(count[i] >0){
21
char ch= i+'a';
22
23
24
25
26
27
return res ;
28
-};
29
+};
0 commit comments