Simple Java Solution using Collections Sort
```\nclass Solution {\n    \n    public int[] sortJumbled(int[] mapping, int[] nums) {\n        int arr[] = new int[nums.length];\n        int index = 0;\n     
```\nclass Solution {\n    \n    public int[] sortJumbled(int[] mapping, int[] nums) {\n        int arr[] = new int[nums.length];\n        int index = 0;\n        Map<Integer,Integer> map = new HashMap<>();\n        List<int []> list = new ArrayList<>();\n         for(int i =0;i<nums.length;i++){\n             int num = nums[i];\n             StringBuffer sb = new StringBuffer();\n             for(char c: (num+"").toCharArray()){\n                 sb.append(mapping[c-\'0\']);\n             }\n            list.add(new int[]{nums[i], Integer.parseInt(sb.toString()),i});\n        }\n        Collections.sort(list, (a,b)->(b[1]-a[1]==0)?a[2]-b[2]:a[1]-b[1]);\n        List<Integer> resultList = new ArrayList<>();\n        \n        for(int []val: list)\n            resultList.add(nums[val[2]]);\n        \n        return resultList.stream().mapToInt(Integer::intValue).toArray();\n    }\n}
[]