100% Easy C# solution
Intuition\nConvert nums to mapped values then sort the mapped values and return the nums in the order of sorted mapped values.\n\n# Approach\n1. Convert all num
# Intuition\nConvert nums to mapped values then sort the mapped values and return the nums in the order of sorted mapped values.\n\n# Approach\n1. Convert all nums into mapped value.\n2. One Dic -> Mapped Value as Key = Value is the list of Nums.\n3. Sort by Keys asc\n4. Result is the list of key - values.    \n\n# Complexity\n- Time complexity:\nO(NlogN)\n\n- Space complexity:\nO(n)\n\n# Code\n```\npublic class Solution {\n    public int[] SortJumbled(int[] mapping, int[] nums) \n    {\n        /*\n          1. Convert all nums into mapped value.\n          2. One Dic -> Mapped Value as Key = Value is the list of Nums.\n          3. Sort by Keys asc\n          4. Result is the list of key - values.       \n        */\n        var dic = new Dictionary<int, List<int>>();\n        var mDic = new Dictionary<int, int>();\n\n        foreach(var n in nums)\n        {\n            var m = 0;\n            if(!mDic.ContainsKey(n))\n            {   \n                m = ProcessMappedValueByNum(mapping, n);\n                mDic.Add(n, m);\n            }\n            else\n                m = mDic[n]; \n\n            if(dic.ContainsKey(m))\n              dic[m].Add(n);\n            else\n              dic.Add(m, new List<int>(){n});\n        }\n\n        //Sort the Key - asc\n        var list = (from kv in dic orderby kv.Key ascending select kv.Key).ToList();\n\n        var res = new List<int>();\n        foreach(var x in list)\n        {\n            res.AddRange(dic[x]);\n        }\n\n        return res.ToArray();        \n    }\n\n    private int ProcessMappedValueByNum(int[] mapping, int n)\n    {\n        var res = 0;\n        var c = 0;\n        if(n <= 9)\n          return mapping[n];\n\n        while(n > 0)\n        {\n           var x = n % 10;\n           x = (int)(Math.Pow(10, c)) * mapping[x];\n           res = x + res; \n           n = n/10;\n           c++;\n        }\n        \n        return res;\n    }\n}\n```\n\nPlease vote up if you like this solution.
['C#']