java easy solution
\npublic String sortString(String s) {\n        int[] chars = new int[26];\n        \n        for(char c:s.toCharArray()){\n            chars[c-\'a\']++;\n     
```\npublic String sortString(String s) {\n        int[] chars = new int[26];\n        \n        for(char c:s.toCharArray()){\n            chars[c-\'a\']++;\n        }\n        StringBuilder output = new StringBuilder();\n        \n        while(output.length()<s.length()){\n            for(int i=0;i<26;i++){\n                if(chars[i] != 0){\n                    output.append((char)(i+\'a\'));\n                    chars[i]--;\n                }\n            }\n            for(int i=25;i>=0;i--){\n                if(chars[i] != 0){\n                    output.append((char)(i+\'a\'));\n                    chars[i]--;\n                }\n            }\n        }\n        \n        return output.toString();\n    }\n```
['Java']