dynamic programming of stairs problem