Google interview question

Dynamic programming problem and array membership problem