
You are given an array of integers, arr. Your task is to process this array and remove all elements that are located at an even index. The remaining elements (those originally at odd indices) should be collected into a new list, preserving their relative order.
The first line contains a single integer N, the size of the array.
The second line contains N space-separated integers, representing the elements of the array.
Print a single line containing the elements that were at odd indices, separated by spaces.
If no elements remain after the removal (e.g., if the input array has only one element), print an empty line.
Array indices are considered 0-based. Therefore, "even places" or "even indices" refer to indices 0, 2, 4, and so on.
6
1 2 3 4 5 6
2 4 6
The array elements are at indices 0 through 5.
Elements at even indices (0, 2, 4) are 1, 3, and 5. These are removed.
Elements at odd indices (1, 3, 5) are 2, 4, and 6. These are kept.
5
10 20 30 40 50
20 40
Elements at even indices (0, 2, 4) are 10, 30, and 50. These are removed.
Elements at odd indices (1, 3) are 20 and 40. These are kept.
The expected time complexity is O(N).
1 <= N <= 10^5
-10^9 <= arr[i] <= 10^9
Time limit: 1 sec