MaxAB interview question

Hash Map problem with any lang