This question evaluates a candidate's understanding of frequency counting, custom sorting with lexicographic tie-breaking, string manipulation, and time/space complexity analysis. It is commonly asked in the Coding & Algorithms domain to assess practical algorithmic implementation and efficiency trade-offs, and it primarily tests practical application rather than purely conceptual understanding.
Given an ASCII string s, reorder its characters in decreasing order of frequency. If multiple characters share the same frequency, break ties by ascending lexicographic order. Return the resulting string. Analyze time and space complexity and provide code.