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

That "char city[32]" looks like a challenge. Lets hope Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch is not in the test set.


Is it really a C program if you cannot execute a buffer overflow attack.


The repo for the original Java-based challenge states that station names will be between 1 and 100 bytes long. In practice, the test data uses shorter names, and the first few bytes of each name happen to be distinct from other names, so you can cut some corners and still arrive at the correct result.


If the application doesn't have to be implemented according to spec, then I propose we skip reading the file and just hard code the results.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

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

Search: