Java Solution Using HashMap
\nclass Solution {\n    public int[] frequencySort(int[] nums) {\n        \n        Map<Integer,Integer> map = new HashMap<>();\n        \n        int L = nums.
```\nclass Solution {\n    public int[] frequencySort(int[] nums) {\n        \n        Map<Integer,Integer> map = new HashMap<>();\n        \n        int L = nums.length;\n\t\t\n\t\t//Store numbers with their occurences in Map\n\t\t\n        for(int i=0;i<L;i++){\n            if(!map.containsKey(nums[i])){\n                map.put(nums[i],1);\n            }\n            else{\n                int g = map.get(nums[i]);\n                ++g;\n                map.put(nums[i],g);\n            }\n        }\n       \n        int index=0;\n        while(!map.isEmpty()){\n            int min=1000,k=0,v=0;\n\t\t\t\n\t\t\t//Select min occuring number and add it in array.\n\t\t\t\n            for(Map.Entry<Integer,Integer> entry : map.entrySet()){\n              \n                \n                v=entry.getValue();\n                if(v<min){\n                    k= entry.getKey();\n                    min=v;\n                }\n                else if(v==min){\n                    if(k<entry.getKey()){\n                        k=entry.getKey();\n                    }\n                }\n            }\n            while(min!=0){\n                nums[index]=k;\n                index++;\n                min--;\n            }\n            \n            map.remove(k);\n            \n        }\n        return nums;\n        \n    }\n}\n```\n\nDo let me know in comments if this code can be improved.\nHappy Coding!!!!
['Java']