Pregunta de entrevista de JPMorganChase

Asked about dsa question with complexities