Amazon interview question

sorted array rotated k times implementing heap data structure