Pergunta de entrevista da empresa Tata Consultancy Services

Introduction Medium level DSA Question, thier optimization approach