Pergunta de entrevista da empresa Google

Dynamic programming problem and array membership problem