Cisco interview question

2 sum. From leetcode. Not that hard