Snap Interview Question

two sum and longest common prefix