Uber interview question

Asked me to solve a leetcode problem