Pergunta de entrevista da empresa Visa Inc.

Better solution than dynamic programming?