Pergunta de entrevista da empresa FactSet

fruit basket(leet code) one qn from gfg