Java Most Possible Solution
\n# Complexity\n- Time complexity:O(N^2)\n Add your time complexity here, e.g. O(n) \n\n# Code\n\nclass Solution {\n    public int[] frequencySort(int[] nums) {
\n# Complexity\n- Time complexity:O(N^2)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n    public int[] frequencySort(int[] nums) {\n        int[] cnt = new int[201];\n        List<Integer> t = new ArrayList<>();\n        for (int v : nums) {\n            v += 100;\n            ++cnt[v];\n            t.add(v);\n        }\n        t.sort((a, b) -> cnt[a] == cnt[b] ? b - a : cnt[a] - cnt[b]);\n        int[] ans = new int[nums.length];\n        int i = 0;\n        for (int v : t) {\n            ans[i++] = v - 100;\n        }\n        return ans;\n    }\n}\n```
['Java']