Problems > Digits That Only Fall > Editorial

Digits That Only Fall — Solution & Editorial

Back to the Problem

Digit DP with prefix difference and tight/leading flags.

Complexity: O(digits · states)