Microsoft Interview Question

had to solve two sum question