Uber interview question

Very standard Leet Codes / HackerRank questions.