Given a number num, you may exchange two neighboring digits whenever they have matching parity: both digits must be odd, or both must be even. For instance, 5 and 9 can be swapped, whereas 6 and 9 cannot.
Determine the greatest number that can be obtained after performing this operation any number of times.
Function Description
Implement the function getLargestNumber in the editor.
getLargestNumber accepts the following parameter:
string num: a string containing digitsReturns
string: the greatest number that can be formed
Constraints:
num ≤ 10^5num contains only the digits 0-9.Input: num = "7596801"
Output: "9758601"