WePay interview question

Basic Hackerank two sum type problem