Optimizing an algorithm that's quadratic by design · HackerLangs