✅💯🔥Simple Code📌🚀| 🔥✔️Easy to understand🎯 | 🎓🧠Beginner friendly🔥| O(n logm) Time Comp.💀💯
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:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n    public int[] sortJumbled(int[] mapping, int[] nums) {\n        int[] result = new int[nums.length];\n        int[][] mappedNums = new int[nums.length][2];  \n        for (int i = 0; i < nums.length; i++) {\n            int original = nums[i];\n            int mappedValue = mapNumber(mapping, original);\n            mappedNums[i][0] = mappedValue;\n            mappedNums[i][1] = i;\n        }      \n        Arrays.sort(mappedNums, (a, b) -> (a[0] == b[0] ? a[1] - b[1] : a[0] - b[0]));       \n        for (int i = 0; i < mappedNums.length; i++) {\n            result[i] = nums[mappedNums[i][1]];\n        }       \n        return result;\n    }   \n    public int mapNumber(int[] mapping, int num) {\n        if (num == 0) return mapping[0];    \n        int mappedNum = 0;\n        int place = 1;\n        while (num > 0) {\n            int digit = num % 10;\n            mappedNum += mapping[digit] * place;\n            place *= 10;\n            num /= 10;\n        }\n       \n        return mappedNum;\n    }\n}\n```\n![7be995b4-0cf4-4fa3-b48b-8086738ea4ba_1699897744.9062278.jpeg](https://assets.leetcode.com/users/images/fe5117c9-43b1-4ec8-8979-20c4c7f78d98_1721303757.4674635.jpeg)
['Array', 'C', 'Sorting', 'Python', 'C++', 'Java']