Contains a Zero — Solution & Editorial
Digit DP with prefix difference and tight/leading flags.
Complexity: O(digits · states)
Watch out: Only non-leading zeros count — a leading zero is not part of the number.
Digit DP with prefix difference and tight/leading flags.
Complexity: O(digits · states)
Watch out: Only non-leading zeros count — a leading zero is not part of the number.