https://leetcode.cn/problems/count-ways-to-build-good-strings/description/
class Solution {
public:
int countGoodStrings(int low, int high, int zero, int one) {
// 动态规划
const int MOD = 1e9+7;
vector<unsigned long long> dp(high+1, 0);
dp[0] = 1;
for(int i=1;i<high+1;i++){
if(i-zero>=0) dp[i] +=dp[i-zero];
if(i-one>=0) dp[i] +=dp[i-one];
dp[i] = dp[i]%MOD;
}
unsigned long long ans = 0;
for(int i=low;i<=high;i++){
ans+=dp[i];
ans%=MOD;
}
return ans;
}
};