Resileo-labs interview question

Problems based on pattern. And hash maps