Pregunta de entrevista de Arkansas Blue Cross and Blue Shield

They asked me about time complexity problem