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

For the interested: enforcing no palindromes and unique digits reduces the number of possible PINs by about a factor of 2, bringing it down to 5040 4-digit combinations.

[JS code] http://pastebin.com/3A46BP1C



If the digits are unique then there are no palindromes. Therefore there are 1098*7 = 5040 combinations.


The formatting ate your *'s but I understand. That's definitely the better way to reason the problem. In my defense it was late (after a trip to the bar) and my code is basically stream of consciousness.




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

Search: