Uber interview question

a coding question on two sum