class Solution:
def waysToChange(self, n: int) -> int:
mod = 1000000007
coins = [25, 10, 5, 1]
dp = [0] * (n + 1) # 滚动数组
dp[0] = 1 # 当总价值为0时, 不计入任何硬币可以满足, 也是一种匹配的方式, 记为1
for coin in coins:
for i in range(coin, n + 1): # 对于当前coin, 比coin更小总价值的不考虑
dp[i] = dp[i] + dp[i - coin]
return dp[-1] % mod