PharmEasy interview question

simple time complexity question based on while and for loops