Dynamic programmingExplained
Digit DP
Count numbers with a property by building them digit by digit.
Time
O(digits · states)
Extra space
O(digits · states)
Use it for
Counting numbers up to N with constraints.
Count numbers with a property by building them digit by digit.
Time
O(digits · states)
Extra space
O(digits · states)
Use it for
Counting numbers up to N with constraints.