Problem 3753 · Hard

Total Waviness of Numbers in Range II

Use a digit DP that counts completions and their waviness, then subtract the prefix up to num1 - 1.

Open the interactive visualisation