C Solution | 100% speed, memory | O(2n)
```\nchar * sortString(char * s){\n    int dict[26]={0}, i, len=strlen(s),p=0;\n    for(i=0;i<len;i++)\n        dict[s[i]-\'a\']++;\n    while(p!=len){\n       
```\nchar * sortString(char * s){\n    int dict[26]={0}, i, len=strlen(s),p=0;\n    for(i=0;i<len;i++)\n        dict[s[i]-\'a\']++;\n    while(p!=len){\n        for(i=0;i<26;i++)\n            if(dict[i]!=0){\n                s[p++]=\'a\'+i;\n                dict[i]--;\n            }\n        for(i=25;i>=0;i--)\n            if(dict[i]!=0){\n                s[p++]=\'a\'+i;\n                dict[i]--;\n            }\n    }\n    return s;\n}\n\nThe code has 2 phases:\n1.  Collecting in a supporting array all the letters (strlen(s) steps)\n2.  Iterating in the 2 directions the dictionary picking one letter at time (strlen(s) steps)\n\nFor a total of 2n operations.
['C']