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

This was the problem in a Perl Golf contest a long, long time ago. There were a couple of minor differences in the spec (trillions didn't need to be handled, the result needed to be pretty-printed with thousand-separator commas).

The explanation by Ton Hospel of the winning solution of 115 characters and the later improvement to 109 chars is a thing of beauty: http://www.mail-archive.com/golf@perl.org/msg01568.html



I heartily agree Ton Hospel's solution is amazing (I DID know the existence of the solution), but it is not the same problem. The main difference comes from the difference between C and Perl (you cannot use crypt() in C unless you sacrifice the portability, and Perl's y/...// will cost more bytes in C), and also from the practicalness (my program filters more invalid words out, reducing false positives a lot). Therefore I believe the direct comparison is meaningless here.


No criticism of your solution implied, just something that I thought people who liked the blog post would also enjoy reading.


Well, sure, but...




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

Search: