Amazon OA
Amazon OA
choice how many groups you have to choose. For each group
calculate the median and that is the answer for that group
-> sort the array -> For the first group we pick 3 largest elements
of the array -> for the second group we pick 4th 5th 6th largest
elements and so on………. are you sure it will always give the best
answer
-> The maximum median possible for first group = second largest
element
Code-
import java.util.*;
Arrays.sort(array);
int group=size/3;
int processed=0;
int total=0;
System.out.println(total);
}
}