Simple JavaScript Solutions w/ RegExp & Sort
\nconst sortString = s => {\n    s = s.split``.sort().join``\n    let result = \'\'\n    while(s.length){\n        result += s.match(/([a-z])(?!\\1)/gi).join``\
```\nconst sortString = s => {\n    s = s.split``.sort().join``\n    let result = \'\'\n    while(s.length){\n        result += s.match(/([a-z])(?!\\1)/gi).join``\n        s = s.replace(/([a-z])(?!\\1)/gi, \'\')\n        result += (s.match(/([a-z])(?!\\1)/gi) || []).reverse().join``\n        s = s.replace(/([a-z])(?!\\1)/gi, \'\')\n    }\n    return result\n};\n```\nw/ Sorting and Character Counting\n```\nconst sortString = s => {\n    let count = Array(26).fill(0), result = \'\'\n    for(const char of s)count[char.charCodeAt() - 97]++\n    let chars = [...new Set(s)].sort()\n    while(result.length < s.length){\n        for(const char of chars){\n            let idx = char.charCodeAt() - 97 \n            if(count[idx]){\n                result += char\n                count[idx]--\n            }\n        }\n        for(let i = chars.length-1; i >= 0; i--){\n            let char = chars[i], idx = char.charCodeAt() - 97\n            if(count[idx]){\n                result += char\n                count[idx]--\n            }\n        }\n    }\n    return result\n}\n```
['JavaScript']