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

Whenever a sequence is graphical, to construct a graph pick any arbitrary node, and connect it to the n other nodes with the largest current numbers (reducing their numbers by one, as the puzzle here does), where n is the number of the node in question. Then pick another arbitrary node, and do the same, iterating until you’ve gone through every node.


As always in these situations, finding an algorithm that works in every case you've tried is fairly straight-forward. Convincing yourself that it's going to work is not that hard.

That challenge is always to prove for definite that it will always work. The proof is in, well, the proof.




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

Search: