Company: Natwest_7aug
Difficulty: medium
Alternate Sorted Elements Problem Description An alternate sort of a list consists of alternate elements (starting from the first position) of the given list after sorting it in an ascending order. You are given a list of unsorted elements. Write an algorithm to find the alternate sort of the given list. The first line of the input consists of an integer size representing the size of the given list (N). The second line consists of N space-separated integers arr_0, arr_1, ..., arr_N-1 representing the elements of input list. Print space-separated integers representing the alternately sorted elements of the given list. Examples Example 1: Input: 7 3 1 5 2 9 5 10 Output: 1 3 5 9 Explanation: After sorting, the list is [1, 2, 3, 5, 5, 9, 10] . The alternate elements of the sorted list (at indices 0, 2, 4, 6) are [1, 3, 5, 9] . Constraints 0 < size <= 10 6 -10 9 <= arr_i <= 10 9