Java | Arrays & Lambda | Sorting | Clean code
Complexity\n- Time complexity: O(n*log(n))\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) \
# Complexity\n- Time complexity: $$O(n*log(n))$$\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 {\n  public int[] sortJumbled(int[] mapping, int[] nums) {\n    var n = nums.length;\n    var arr = new int[n][2];\n\n    for (var i = 0; i < n; i++) {\n      arr[i][0] = nums[i];\n      \n      if (nums[i] == 0)\n        arr[i][1] = mapping[0];\n\n      for (int j = nums[i], k = 1; j > 0; j /= 10, k *= 10)\n        arr[i][1] += (mapping[j % 10] * k);\n    }\n    Arrays.sort(arr, (a, b) -> Integer.compare(a[1], b[1]));\n\n    for (var i = 0; i < n; i++)\n      nums[i] = arr[i][0];\n\n    return nums;\n  }\n}\n```\nIf you like my solution, please upvote it!
['Array', 'Sorting', 'Java']