Pregunta de entrevista de Samsung Electronics

Dynamic programming questions, math questions