Whatfix Interview Question

A medium LC problem with hashmap use