Media of Two Sorted Arrays, Run time complexity error