The algorithm for a perfectly balanced photo gallery | Dark Hacker News