Simple Java HashMap solution without custom comparator
Explanation:\nFirst you make a new array of nums size in order to store mapped elements there  and also make a HashMap of integers and arraylist\nwhy hashmap of
Explanation:\nFirst you make a new array of nums size in order to store mapped elements there  and also make a HashMap of integers and arraylist\nwhy hashmap of integers and arraylist ?\nbecause mapped elements can repeat which we are taking here as key and we also have to maintain the order if elements are repeated.\nNow in order to map the elements \n we are taking single single digit of element and adding it\'s mapped digit in mapped_number while increasing its tens place.\n Since it will not consider the 0 value we have to add an if statement in order to handle it\n And then storing it into mapped array\n and also storing mapped element and number using hashmap.\n Then just sort the mapped array \n and run a loop through the mapped array and for every mapped element get its number and put it in the nums array index wise.\n Also keep the check that we are not storing the same repeated element by if statement\n and keep on removing the elements from hashmap.\n \n \n Now heres the code\n```\nclass Solution {\n    public int[] sortJumbled(int[] mapping, int[] nums) {\n        int []mapped = new int[nums.length];\n        HashMap<Integer, ArrayList<Integer>> map = new HashMap<>();\n        for(int i = 0; i < nums.length; i++){\n            int number = nums[i];\n            int idx = 1;\n            int mapped_number = 0;\n            while (number > 0) {\n            int remainder = number % 10;\n            mapped_number = mapped_number + (mapping[remainder] * idx );\n            number = number / 10;\n            idx *= 10;\n        }\n            if(nums[i] == 0){\n                mapped_number = mapping[0];\n            }\n            mapped[i] = mapped_number;\n            if (!map.containsKey(ans[i])) {\n            map.put(mapped[i], new ArrayList<Integer>());\n            }\n            map.get(mapped[i]).add(nums[i]);\n                \n        }\n        Arrays.sort(mapped);\n        int idx = 0;\n        for(int i = 0; i < mapped.length; i++){\n            if(map.containsKey(mapped[i])){\n            for(int val: map.get(mapped[i])){\n                nums[idx] = val;\n                idx++;\n            }\n            }\n            map.remove(mapped[i]);\n        }\n        return nums;\n    }\n}\n```
['Sorting', 'Java']