Capital One Interview Question

Two sum from leet code