Whatnot interview question

String hashmap lc medium prob.