Hacker News new | ask | show | jobs
by somehnreader 2651 days ago
Or if you are like me (and a bit stupid):

1000 = all possible combinations from 000 to 999.

less 10 combinations with all numbers identical is 990.

now there are three patterns for numbers to be identical left that need to be taken out: 00x 0x0 x00. The x can be replaced with all digits != 0 in this example, so thats 3 (patterns) x 9 ('x' digits) = 27. That times 10 digits that can have double patterns is 270.

1000 - 10 - 270 = 720.

1 comments

Hmmm. I wouldn't have approached it that way. Thanks for sharing! Lots of ways to approach any problem.