Use bitmask to track used elements. Ten digits fit in a 10-bit integer.
Leading zeros need special handling. Don't mark as used until you've started.
The base case checks "started." An empty number (all leading zeros) doesn't count. This pattern (digit DP + bitmask) appears whenever you need to track which digits or elements you've used. Apply these patterns when you encounter similar problems.