Premium problem92. A Digit Appears Twice

Medium Locked

Pick an n-digit number uniformly at random, so the leading digit is 1 to 9 and the rest are 0 to 9. Return the probability that some digit appears more than once.

Count the all-distinct numbers: 9 choices for the first digit, then 9 remaining for the second (zero is back in play), then 8, and so on.

Input

3

Output

0.28

Premium problem

This one's part of Premium. Unlock the full Probability track plus every other premium problem on the site.

Implement solve(...)