solution - dp

solution - dp