# 2327. Number of People Aware of a Secret ###### tags: `dp` ![](https://hackmd.io/_uploads/BJ-EGwJi9.png) ```python= class Solution: def peopleAwareOfSecret(self, n: int, delay: int, forget: int) -> int: # dp[i] is the num of ppl starting to know secret at i-th day dp=[0]*(n+1) # will not use dp[0] dp[1]=1 # the person A for i,x in enumerate(dp): if i==0: continue # will not use dp[0] for j in range(i+delay,i+forget): if j > n: break dp[j] += x # want to know num fo ppl still remenber secret return sum(dp[-forget:])%1000000007 ```