Efficient C++ Solution for Sorting Numbers with Custom Digit Mapping
---This solution implements a custom sorting algorithm for the problem "Sort Jumbled." The goal is to sort a list of numbers based on a given mapping of digits.
**---This solution implements a custom sorting algorithm for the problem "Sort Jumbled." The goal is to sort a list of numbers based on a given mapping of digits.**\n\n\n\n# SOLUTION\n\n    class Solution {\n    public:\n        int mapp(int x ,vector<int>& mapping){\n            int num ; \n            if(x == 0) return mapping[0] ;\n            string s = "" ;\n            while(x > 0){\n                int r = x % 10 ;\n                x /= 10 ;\n                int mp = mapping[r] ; \n                s += to_string(mp) ; \n            }\n            reverse(s.begin() , s.end()) ; \n            \n            cout<<s<<endl ;\n            return stoi(s) ;\n        }\n\n        vector<int> sortJumbled(vector<int>& mapping, vector<int>& nums) {\n            \n            vector<pair<int,int>>vp ; \n            for(auto x : nums){\n                vp.emplace_back(x,mapp(x,mapping)) ;\n            }\n            stable_sort(vp.begin(), vp.end(), [](const pair<int, int>& a, const pair<int, int>& b) {\n                return a.second < b.second;\n            });\n            vector<int>v; \n            for(auto x  : vp){\n                v.push_back(x.first) ;\n            }\n            return v ;\n        }\n    };\n
['Array', 'Sorting', 'Simulation', 'C++']