Problems with tag O(n^2 * logn)