Pregunta de entrevista de Robinhood

string manipulation, dynamic programming / optimization