I thought about doing this in sort array and save the index of the median and its takes O(1). but I couldn\'t think about any way to do the insert in O(1) and keep the array sor