Java O(n) - Clean & Simple Solution (No Auxiliary DS)
Hit the UPVOTE! :) Thankyou <3\n\nclass Solution {\n    public String sortString(String s) {\n        \n        StringBuilder temp = new StringBuilder(s);\n    
**Hit the UPVOTE! :) Thankyou <3**\n```\nclass Solution {\n    public String sortString(String s) {\n        \n        StringBuilder temp = new StringBuilder(s);\n        StringBuilder sb = new StringBuilder();\n        \n        while(temp.length() != 0){\n            for(char c=\'a\';c<=\'z\';c++){\n                int index = temp.indexOf(c+"");\n                if(index != -1){\n                    sb.append(c);\n                    temp.deleteCharAt(index);\n                }\n               \n            }\n            for(char c=\'z\';c>=\'a\';c--){\n                int index = temp.indexOf(c+"");\n                if(index != -1){\n                    sb.append(c);\n                    temp.deleteCharAt(index);\n                }               \n            }\n        }\n        \n        return sb.toString();\n    }\n}\n```
['Java']