<prompt> Andika kazi ambayo huamua hii: Wewe ni kupanda ngazi. Inachukua hatua n kufikia juu. Kila wakati unaweza ama kupanda 1 au 2 ngazi. Katika njia ngapi tofauti unaweza kupanda hadi juu?  <response>: Heres the function that solves the problem using dynamic programming:def climbStairsn: int - int: if n 1: return 1 dp 0 n1 dp1 1 dp2 2 for i in range3, n1: dpi dpi-1 dpi-2 return dpnThe function takes an integer n as input, which represents the number of steps in the staircase. It returns the number of distinct ways to climb to the top.The function uses dynamic programming to solve the problem. It initializes an array dp of length n1 with all values set to 0. It then sets dp1 to 1, since there is only one way to climb one step. It sets dp2 to 2, since there are two ways to climb two steps by climbing two steps at once or by climbing one step twice.The function then uses a loop to fill in the remaining values of dp. For each value i from 3 to n, it computes dpi as the sum of dpi-1 and dpi-2. This is because you can reach the i-th step either by climbing one step from the i-1-th step or by climbing two steps from the i-2-th step.Finally, the function returns dpn, which is the number of distinct ways to climb to the top. 