Broken Profile Dynamic Programming: Grid Tiling & Contour Line State Transitions

When tiling an $N imes M$ grid with dominoes, standard row-by-row bitmask DP requires evaluating all valid row transitions in $O(M 2^{2N})$. Broken Profile DP advances cell-by-cell along a contour boundary, reducing transition branching to $O(1)$ per cell and overall complexity to $O(N M 2^N)$.

Ready to Master LeetCode Hard Patterns?

Get instant lifetime access to all 45 video lectures, interactive source code templates, and interview prep guides.

Enroll in Masterclass ($49)

Disclaimer: LeetCode is a registered trademark of LeetCode LLC. Our tutorials are independent educational guides developed by industry veterans and are not affiliated with LeetCode.