Simple C code
\n# Approach\n Describe your approach to solving the problem. \n- First loop to store the char count in the hash table\n- While loop keep track to number of exe
\n# Approach\n<!-- Describe your approach to solving the problem. -->\n- First loop to store the char count in the hash table\n- While loop keep track to number of execution to repeat the steps\n- Inside the while first for loop to store in increasing order\n- Second for loop to store it in decreasing order\n\n# Code\n```c []\nchar* sortString(char* s) {\n    int arr[26]={0};\n    int len = strlen(s);\n    for(int i=0;i<len;i++)\n    {\n        arr[s[i]-\'a\']++;\n    }\n    char *str = malloc(len+1);\n    int ind=0;\n    while(len>0){\n        for(int i=0;i<26;i++)\n        {\n            if(arr[i]!=0){\n                str[ind++] = i+\'a\';\n                arr[i]--;\n                len--;\n            }\n        }\n        for(int i=25;i>=0;i--)\n        {\n            if(arr[i]!=0){\n                str[ind++]=i+\'a\';\n                arr[i]--;\n                len--;\n            }\n        }\n    }\n    str[ind]=\'\\0\';\n    return str;\n}\n```
['C']