Revature | Alternating Array Rearrangement | String Vowel Partitioning | 10 Jan, 2026

Question · Posted Mar 2026

Question: Rearrange Array Alternately Problem Statement Given a sorted array arr, you have to rearrange the array elements alternatively i.e first element should be max value, second should be min value, third should be second max, fourth should be second min and so on... Input Format First line of input contains an integer n denoting the size of the array. The following n lines contain array elements. Constraints 1 <= n <= [obscured in image, typically $10^5$] 1 <= arr[i] ...

The full answer & interview discussion are available to premium members.

Log in Create a free account