Back

JS - Array Max and Min

Created 1 year ago
88 Views
1 Comments
Ajar_Lapog
@Ajar_Lapog
Ajar_Lapog
@Ajar_LapogProfile is locked. Login

An alternative array is an array in which first element is maximum of the whole array second element is minimum of the whole array. Third element is the second largest. Fourth element is the second smallest And so on. print the array in the desired manner.

I know the Qus and concept. But don't know the code.

Give the code with comment

Sample Input :
5 1 7 11 16 19
Sample Output :
19 1 16 7 11
Comments
Please login to comment.