Siemens interview question

hashing and time complexity based