70ms | Sorting | Beginner Friendly
Intuition\n Describe your first thoughts on how to solve this problem. \nBasic intution upon seeing this problem is to store the decoded values of nums in a sep
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nBasic intution upon seeing this problem is to store the decoded values of nums in a seperate array and use them for sorting this array.\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n- Store the decoded values in seperate array\n- now sort the indices of this array according to the decoded value.\n- update the nums array according to the index array\n\n# Complexity\n- Time complexity: O(nlogn)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(n)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution:\n    def sortJumbled(self, mapping: List[int], nums: List[int]) -> List[int]:\n        null=[]\n        for num in nums:\n            curr=0\n            num=str(num)\n            for i in range(len(num)):\n                curr=curr*10+mapping[int(num[i])]\n            null.append(curr)\n        print(null)\n\n        idx=[i for i in range(len(null))]\n        idx.sort(key=lambda x:null[x])\n        print(idx)\n        res=[]\n        for index in idx:\n            res.append(nums[index])\n        return res\n```\n\n# UPVOTE IF USEFUL!
['Sorting', 'Python3']