Cognizant Interview Question

code for hash map