Easy Solution using sorting
Intuition\n Describe your first thoughts on how to solve this problem. \nsort after mapping\n# Approach\n Describe your approach to solving the problem. \nmap e
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nsort after mapping\n# Approach\n<!-- Describe your approach to solving the problem. -->\nmap each number and then sort using built sort function\n# Complexity\n- Time complexity:$$O(n * logn * logn) -> n*logn(sorting)- logn(mapping)$$\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 {\npublic:\n\n    int transform(int num, vector<int> mapping) {\n        int ans = 0, p = 1;\n        if (num == 0) return mapping[0]; \n\n        while (num) {\n            ans = ans  + mapping[num >= 10 ? num % 10 : num] * p;\n            num = num / 10;\n            p = p * 10;\n        }\n        return ans;\n    }\n\n\n    vector<int> sortJumbled(vector<int>& mapping, vector<int>& nums) {\n        unordered_map<int, int> mp;\n        \n        for (int num : nums) mp[num] = transform(num, mapping);\n\n        sort(nums.begin(), nums.end(), [&](int x, int y)->bool{\n            return mp[x] < mp[y];\n        });\n\n        return nums;\n    }\n};\n```
['Sorting', 'C++']