Dynamic Programming21 sections · 916 units
Open in Course

Common Mistakes

Pitfalls to avoid

Mistake 11: Forgetting that profiles represent which cells are already filled, not which cells are empty. If you invert the meaning, your transitions will be backwards. Mistake 22: Not handling the base case correctly.

You must start with dp[0][0]=1dp[0][0] = 1 (or the equivalent for your indexing). Starting with all zeros gives zero tilings. Mistake 33: Off-by-one errors in bit indexing. Bit ii corresponds to row ii, but if you're not consistent about 00-indexed vs 11-indexed, you'll set wrong bits. Test on small cases.