Genesys interview question

it was a litcode question from hashmapp section