Here is what I currently have:
unique = 0
while n > 0:
last, n = n % 10, n // 10
if not has_digit(n, last):
unique += 1
return unique
I'm trying to have it so for every unique number in an integer, it outputs how many unique numbers there are.
For Example:
unique_digits(123456) = 6
unique_digits(112222) = 2
>>> unique_digits(8675309) # All are unique
7
>>> unique_digits(1313131) # 1 and 3
2
>>> unique_digits(13173131) # 1, 3, and 7
3
>>> unique_digits(10000) # 0 and 1
2
>>> unique_digits(101) # 0 and 1
2
>>> unique_digits(10) # 0 and 1
2
"""