Trying to wrap my head around the solution for 25.3 and not understanding how the first algorithm is O(kn^2) and actually not understanding what this first algorithm is supposed to do. Is it iterating i := 0 through A.size() and at each i, calculate j pairs? Or does it just calculate j pairs once from 0 through A.size()?
Also, it would be great to include some examples and a more thorough explanation of the optimal solution. Totally not understanding it.
Thanks,
tacocat