Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Solution:
- def countNumbersWithUniqueDigits(self, n: int) -> int:
- s,cnt=1,1
- for m in range(1 , min(11 , n+1)):
- s += 9 * cnt
- cnt *= cnt (10-m)
- return s
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement