IXL Learning Interview Question

Using data structure such as set and dictionary to solve the problem.