SelfEmployed.com interview question

Two Sum coding question for the technical part