Easy-to-follow..
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:O(nlogn)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:O(2n)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n    public int[] frequencySort(int[] nums) {\n        HashMap<Integer,Integer>map=new HashMap<>();\n        int n=nums.length;\n        for(int i:nums){\n            map.put(i,map.getOrDefault(i,0)+1);\n        }\n        Integer temp[]=new Integer[n];\n        for(int i=0;i<n;i++){\n            temp[i]=nums[i];\n        }\n        Arrays.sort(temp, new Comparator<Integer>(){\n            public int compare(Integer a,Integer b){\n                if(map.get(a)==map.get(b)){\n                    return b-a;\n                }return map.get(a)-map.get(b);\n            }\n        });\n         for(int i=0;i<n;i++){\n            nums[i]=temp[i];\n        }\n       return nums;\n    }\n}\n```
['Array', 'Hash Table', 'Sorting', 'Java']