Samsung Electronics interview question

Dynamic programming questions, math questions