Java Solution Using PRIORITYQUEUE
\nclass Solution {\n    public int[] sortJumbled(int[] mapping, int[] nums) {\n        PriorityQueue<Pair> pq = new PriorityQueue<>();\n        int[] arr = new 
```\nclass Solution {\n    public int[] sortJumbled(int[] mapping, int[] nums) {\n        PriorityQueue<Pair> pq = new PriorityQueue<>();\n        int[] arr = new int[nums.length];\n        int k = 0;\n        for(int j = 0 ; j < nums.length ; j++){\n            String str = nums[j] + "";\n            String nstr = "";\n            for(int i = 0 ; i < str.length() ; i++){\n                nstr += mapping[str.charAt(i) - \'0\'];\n            }\n            int no = Integer.parseInt(nstr);\n            pq.add(new Pair(j , no));\n        }\n        while(pq.size() != 0){\n            Pair rp = pq.remove();\n            arr[k++] = nums[rp.idx];\n        }\n        \n        return arr;\n    }\n    public class Pair implements Comparable<Pair>{\n        int idx;\n        int no;\n        public Pair(int idx , int no){\n            this.idx = idx;\n            this.no = no;\n        }\n        public int compareTo(Pair o){\n            if(this.no == o.no) return this.idx - o.idx;\n            else return this.no - o.no;\n        }\n    }\n}\n```
['Heap (Priority Queue)', 'Java']