Simple Java Solution - Count Array
Code\n\nclass Solution {\n    public String sortString(String s) {\n        int[] alpha = new int[27];\n        for(char ch : s.toCharArray())\n        {\n     
# Code\n```\nclass Solution {\n    public String sortString(String s) {\n        int[] alpha = new int[27];\n        for(char ch : s.toCharArray())\n        {\n            alpha[ch-\'a\']++;\n        }\n        String result = "";\n        boolean flag = false;\n        while(flag!=true)\n        {\n            flag = true;\n            for(int i = 0;i<27;i++)\n            {\n                if(alpha[i]!=0)\n                {\n                    result = result+(char)(i+97);\n                    alpha[i]--;\n                    flag = false;\n                }\n            }\n            flag = true;\n            for(int j = 26;j>=0;j--)\n            {\n                if(alpha[j]!=0)\n                {\n                    result = result+(char)(j+97);\n                    alpha[j]--;\n                    flag = false;\n                }\n            }\n        }\n        return result;\n    }\n}\n```
['Counting', 'Counting Sort', 'C++', 'Java', 'Python3']