Even Number of Digits — Solution & Editorial
Digit DP with prefix difference and tight/leading flags.
Complexity: O(digits · states)
Watch out: Track digit-count parity, but leading zeros do not add to the digit count.
Digit DP with prefix difference and tight/leading flags.
Complexity: O(digits · states)
Watch out: Track digit-count parity, but leading zeros do not add to the digit count.