hi, I am actually completely clueless abt this ques of Counting towers: plz help me with it:
DP Counting towers
1 Like
this is bitmasking-profile dp, but if you look it carefully you can easily convert those mask into various states, and then it gets converted to linear recursion dp. it would look like dp[i] = adp[i-1] + bdp[i-2] + … upto atmost 6 states. so you can do 6-equation 6 variable calculation, or easy way is to just look for the series in oeis.
https://oeis.org/A034999
1 Like