returnA's blog

By returnA, history, 16 months ago, In English

 Keval has forgotten the password to his I-Pad. The password is a 4-digit number where each digit takes a value from 0 to 9. The good thing is that Keval remembers that his password had exactly two unique digits, and each of these digits appeared exactly twice in the password. Keval also remembers that n digits (where, 0 ≤ n ≤ 10) from 0-9 were definitely not used in the password.

Find the number of different possible passwords Keval could have. Note that the password can start with the digit 0

Input constraints 0 ≤ n ≤ 10

Input format The only line of input contains a single integer n, the number of digits which were not used in the password.

Output Format Output a single integer that denotes the number of possible password sequences.

  • Vote: I like it
  • 0
  • Vote: I do not like it

»
16 months ago, # |
  Vote: I like it +8 Vote: I do not like it

c(10-n,2)*c(4,2)

cause you must choose 2 of 10-n valid digit for password and they have c(4,2) permutation