ServiceNow interview question

It was leetcode easy to medium, implement two sum