Sort Jumbled Numbers By Mapped Values
Sort Jumbled Numbers: Map each digit in nums to its corresponding value in mapping array. Sort mapped values while preserving original order for equal values.
2191. Sort the Jumbled Numbers Medium You are given a 0-indexed integer array mapping which represents the mapping rule of a shuffled decimal system. mapping[i] = j means digit i should be mapped to digit j in this system. The mapped value of an integer is the new integer obtained by replacing each occurrence of digit i in the integer with mapping[i] for all 0 <= i <= 9. You are also given another integer array nums. Return the array nums sorted in non-decreasing order based on the mapped values of its elements. Notes: Elements with the same mapped values should appear in the same relative or...
