UKG interview question

2 sum problem of leetcode