Rust simple solution, 0ms
Rust\nimpl Solution {\n    pub fn sort_string(s: String) -> String {\n        let mut arr = vec![0; 26];\n        for c in s.chars() {\n            arr[c as usi
```Rust\nimpl Solution {\n    pub fn sort_string(s: String) -> String {\n        let mut arr = vec![0; 26];\n        for c in s.chars() {\n            arr[c as usize - \'a\' as usize] += 1;\n        }\n        let mut res = String::from("");\n        let mut cter = s.len();\n        let mut pivot = 0;\n\n        while cter > 0 {\n            for i in 0..26 {\n                let j = if pivot == 0 {i as usize} else {(25 - i) as usize};\n                if arr[j] > 0 {\n                    arr[j] -= 1;\n                    res.push((j as u8 + 97) as char);\n                    cter -= 1;\n                }\n            }\n            pivot = 1 - pivot;\n        }\n        res\n    }\n}\n\n```
[]