Increasing Decreasing String Solution Java
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n    public String sortString(String s) {\n        int len = s.length();\n        int[] freq = new int[26];\n        for (int i = 0; i < len; i++) {\n            freq[s.charAt(i) - \'a\']++;\n        }\n        StringBuilder sb = new StringBuilder();\n        int count = 0;\n        while (count < len) {\n            for (int i = 0; i < 26; i++) {\n                if (freq[i] > 0) {\n                    sb.append((char) (i + \'a\'));\n                    freq[i]--;\n                    count++;\n                }\n            }\n\n            for (int i = 25; i >= 0; i--) {\n                if (freq[i] > 0) {\n                    sb.append((char) (i + \'a\'));\n                    freq[i]--;\n                    count++;\n                }\n            }\n        }\n        return sb.toString();\n    }\n}\n\n```
['Hash Table', 'String', 'Counting', 'Java']