Even Digit Product — Solution & Editorial
Digit DP with prefix difference and tight/leading flags.
Complexity: O(digits · states)
Watch out: A leading zero is not part of the number, so it should not make the product even.
Digit DP with prefix difference and tight/leading flags.
Complexity: O(digits · states)
Watch out: A leading zero is not part of the number, so it should not make the product even.