since each digit should appear atleast twice
so 4 cases are possible
case 1: three digits appear two times each
so no. of ways of selcting those three digits = 5 C 3 = 10
no . of of arranging = 6!/2!*2!*2! = 90
so total nos = 10 * 90 = 900
case 2: two digits appear three times each
so no. of ways of selecting = 5 C 2 = 10
no. of ways of arranging = 6!/3!*3! = 20
so total nos. = 200
case 3: one digit appears four times & the other two times
no of ways in which the no. which appears four times can be selected is 5C1 = 5 ways
no . of ways in which the other no. can be selected from the remaining set of four nos. is 4C1 = 4 ways
arrangement can be done in 6!/4!*2!
so total nos = 5 * 4 * 6!/4!*2! = 300
case 4: all digits are same
total nos 5
so adding all cases total nos = 900 + 200 + 300 + 5 = 1405