Define = count of valid special integers from position onward. : bitmask of used digits. Bit is if digit has been placed.
Why "started"? Leading zeros don't count as using digit . The number is , and isn't "used." You only start tracking the mask once you place a real digit. Choosing what dp tracks is often the hardest part. Each dp value must have enough information to count valid numbers from that position onward.