Amazon Interview Question

Two sum lc question a