Pregunta de entrevista de Tata Consultancy Services

Introduction Medium level DSA Question, thier optimization approach