Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The analytic solution also isn't particularly difficult, just tedious to work through by hand.

There's 10 valid ways to choose the first digit. You either repeat that digit one or zero times. If once, there are 8 ways to do this, and then you have the same sub-problem except with 9 remaining characters to use and 7 remaining places to fill. If none, there's one way to do it, and then you have the same problem except with 9 remaining characters to use and 8 remaining places to fill.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: