Sort odd indices in ascending order and even indices in descending order of the string
Given a string S, the task is to sort odd indices in ascending order and even indices in descending order of the string. Examples: Input: S = “Cplusplus” Output: Cululspsp Explanation: Sort string S in ascending order: S = “Cululspsp” Replace odd indices in ascensing order and even indices in descending order. Input: S = “plusplus” Output: lulupsps… Read More »
