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

They would certainly have to be bounded integers, right?


Yes, I believe it is something like O(n) where n is the sum of all the distances.

It's probably related to the "pseudopolynomial time subset-sum" algorithm.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

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

Search: