Resileo-labs Interview Question

Problems based on pattern. And hash maps