Visa Inc. interview question

2 sum and leet code 277