Sorted Lambda
\nWe will use Python to leverage @cache.\n> Note: the solution is accepted without cahce (since constraints are relaxed).\n\nWatch for 0 edge case and convert i
\nWe will use Python to leverage `@cache`.\n> Note: the solution is accepted without cahce (since constraints are relaxed).\n\nWatch for `0` edge case and convert it to a number using `mapping`.\n\n**Python**\n```python\nclass Solution:\n    def sortJumbled(self, mapping: List[int], nums: List[int]) -> List[int]:\n        @cache\n        def convert(i: int):\n            res, pow10 = 0, 1\n            while i:\n                res += pow10 * mapping[i % 10]\n                i //= 10\n                pow10 *= 10\n            return res\n        return sorted(nums, key=lambda i: mapping[i] if i < 10 else convert(i))\n```\n\nYou can also convert the array first, and sort it that way. Counter-intuitively, the runtime for this solution is a bit slower.\n**Python**\n```python\n        nums = zip(nums, [mapping[i] if i < 10 else convert(i) for i in nums])\n        return [a for a, b in sorted(nums, key = lambda i: i[1])]\n```
['Python3']