BEATS 99%: using vector pair sorting
\n\n# Code\n\nclass Solution {\npublic:\n    vector<int> sortJumbled(vector<int>& mapping, vector<int>& nums) {\n        vector<pair<int,int>> vec;\n        for
\n\n# Code\n```\nclass Solution {\npublic:\n    vector<int> sortJumbled(vector<int>& mapping, vector<int>& nums) {\n        vector<pair<int,int>> vec;\n        for(int i=0; i<nums.size(); i++) {\n            int x = nums[i];\n            int y = 0, cnt = 0;\n            while(x != 0) {\n                int tmp = x%10;\n                x = x/10;\n                y += (mapping[tmp]*pow(10,cnt));\n                cnt++;\n            }\n            if(nums[i] == 0) y = mapping[0];\n            vec.push_back({y,i});\n        }\n        sort(vec.begin(), vec.end());\n        \n        vector<int> ans;\n        for(auto x: vec) {\n            ans.push_back(nums[x.second]);\n        }\n\n        return ans;\n    }\n};\n```
['Sorting', 'C++']