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

Yup. I updated my comment with working code. Just figure out the small case, and extrapolate once you find a match.


Nice approach!

It's O(1) to find a candidate solution, but of course it will still be O(N) to verify that the solution really works.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

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

Search: