Find the number of 6 digit numbers such that each digit appears atleast twice
I tried the below code but it doesn't work:
count = 0
for n in range(10**5,(10**6)-1):
n = str(n).split()
for i in range(len(n)):
n[i] = int(n[i])
if n.count(i) >= 2:
count+=1
print(count)
The original question is of Permutation and Combinations but I want to solve this using python...