C++ | Easy Solution | lambda expression | Commented
If you find this solution helpful, please upvote. Also share your ideas in the comment box\n\nclass Solution {\npublic:\n    // function for converting a given 
***If you find this solution helpful, please upvote. Also share your ideas in the comment box***\n```\nclass Solution {\npublic:\n    // function for converting a given number n according to mapped values\n    int calculate(int n, vector<int>& map){\n        int ans = 0, mul = 1;\n        if(n == 0)\n            return map[0];\n        while(n != 0){\n            int digit = n % 10;\n            ans += map[digit] * mul;\n            mul *= 10;\n            n /= 10;\n        }\n        return ans;\n    }\n    \n    vector<int> sortJumbled(vector<int>& mapping, vector<int>& nums) {\n        // C++ lambda expression for the rule for sorting.\n        sort(begin(nums), end(nums), [&](int x , int y){\n            return calculate(x, mapping) < calculate(y, mapping);\n        });\n        return nums;\n    }\n};\n```
['C']