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

This isn't "brute force." It's solving the specific problem posed rather than a generalization, which in this case is both easier and more efficient (since there are cases in which you could terminate the loop early).


Thanks! I completely misunderstood what the commentator I replied to was saying. Not understanding how to solve it well I assumed they were referring the first option with loops and tests that popped into my head: make every one-edit possible and see if it's one of them.




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

Search: