Genesys Interview Question

it was a litcode question from hashmapp section