For a certain alarm system, each code is comprised of 5 digits, but no digit can be used more than twice. How many codes can be made?	Choose the correct choice from the following options:	A) 30,240	B) 60,480	C) 91,440	D) 98,240	E) 101,040
Case 1: All digits distinct   Select 5 digits out of 10 in 10C5 ways and arrange them in 5! ways which gives us 10C5x5! = 30240   Case 2: Two digits are same, other 3 are distinct e.g. 45722   Select a digit which is to be repeated in 10C1 ways, select other 3 digits in 9C3 ways and arrange them in 5!/2! ways to get 10C1 x 9C3 x 5!/2! = 50400 ways   Case 3: Two digits repeated and one other digit e.g. 33448   Select 2 digits to be repeated in 1091,4402 ways, select the single digit in 891,4401 ways and arrange them all in 5!/2!.2! ways to get 1091,4402 x 891,4401 x 5!/2!.2! = 10800   Sum of all = 30240 + 50400 + 10800= 
<gadget id="calculator">30240 + 50400 + 10800</gadget>
<output>91_440</output>
91440 ways   ANS:91,440
<result>C</result>
For a certain alarm system, each code is comprised of 5 digits, but no digit can be used more than twice. How many codes can be made?