Easy Solution in Python
Intuition\n\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \nMapping Construction:
# Intuition\n\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\nMapping Construction: The mapping array provides a transformation for each digit (0-9). We first construct a dictionary d where the key is the digit and the value is its mapped counterpart.\n\nTransforming Numbers: For each number in nums, we convert the digits of the number into their mapped values to create a "mapped" number. This transformation is done digit by digit:\n\nIf the number is 0, it directly uses the mapped value of 0.\nOtherwise, we extract each digit of the number, replace it with its mapped value, and reassemble the number.\nSorting Based on Mapped Values: After transforming all numbers, we pair the transformed numbers with the original numbers. These pairs are then sorted based on the transformed values, and the original numbers are returned in the sorted order.\n\n# Complexity\n- Time complexity:\n- O(nlogn)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n- O(n)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n# Key Points\n- The dictionary d maps each digit to its corresponding transformed value.\n- We handle each number, converting it into its transformed version using the mapping.\n- We use Python\'s zip function to pair transformed and original numbers, sort based on transformed values, and then extract the original numbers in the new order.\n# Code\n```\nclass Solution:\n    def sortJumbled(self, mapping: List[int], nums: List[int]) -> List[int]:\n        d={}\n        j=0\n        s=[]\n        ans=[]\n        for i in mapping:\n            d[j]=i\n            j+=1\n        for num in nums:\n            if num==0:\n                temp=d[0]\n            else:\n                temp=0\n            mul=1\n            while num>0:\n                a=num%10\n                a=d[a]\n                temp+=a*mul\n                mul=mul*10\n                num=num//10\n            s.append(temp)\n        # sorted_combined = sorted(zip(s,nums))\n        # print(sorted_combined)\n        # # Extract the sorted arr1 values\n        # sorted_arr1 = [x for _, x in sorted_combined]\n        sorted_arr1 = [x for _, x in sorted(zip(s,nums), key=lambda pair: pair[0])]\n        return sorted_arr1\n\n        \n```
['Array', 'Sorting', 'Python3']