JAVA fast solution based on the solutions of others - thank you!
\nclass Solution {\n    public String sortString(String s) {\n        StringBuilder charString = new StringBuilder(s.length());\n        int[] charFrequency = n
```\nclass Solution {\n    public String sortString(String s) {\n        StringBuilder charString = new StringBuilder(s.length());\n        int[] charFrequency = new int[26];\n        int charCount = 0;\n        \n        // store the frequency with which characters appear in s into an array  \n        // sized to hold all lowercase letters\n        for (int i = 0; i < s.length(); i++) {\n            charFrequency[s.charAt(i)-\'a\']++;\n        }\n        \n        while (charCount < s.length()) {\n            // add characters to result in ascending order\n            for (int j = 0; j < 26; j++) {\n                if (charFrequency[j] > 0) {\n                    charString.append((char)(j + \'a\'));\n                    charFrequency[j] = charFrequency[j] - 1;\n                    charCount++;\n                }\n            }\n            //add characters to result in descending order\n            for (int k = 25; k >=0; k--) {\n                if (charFrequency[k] > 0) {\n                    charString.append((char)(k + \'a\'));\n                    charFrequency[k] = charFrequency[k] - 1;\n                    charCount++;\n                }\n            }\n        }\n        return charString.toString();\n    }\n}\n```
[]