...

/

Challenge 10: Rearrange Sorted Array in Max/Min Form

Challenge 10: Rearrange Sorted Array in Max/Min Form

Arrange elements in such a way that the maximum element appears first, then the minimum second, then second maximum at the third position, the second minimum at fourth, and so on.

Problem statement

Implement a function fn max_min(arr: &Vec<i32>) -> Vec<i32>, which takes a reference to a sorted array arr and will rearrange the elements of a sorted array such that the first ...

Access this course and 1400+ top-rated courses and projects.