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

If I understand the example correctly, the problem with the incorrect greedy solution is that it locks on the first prefix it finds in the dictionary and then, if the rest of the string is not a word, fails. It's wrong because maybe the greedy prefix wasn't the right way to split.


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: