Sort even indices digits in ascending order and odd indices digits in descending order
Given a number num (0 < num < 108), the task is to sort the digits of the number such that even indices are in ascending order and odd indices in descending order. Examples: Input: num = 1423 Output: 4132 Explanation: Sort number num in ascending order: num = 1234 Replace even indices in ascensing order: *1*2 And… Read More »