I have to find a solution for this equation:
I have to find the set of solutions a, b, c, d for all possible combinations of values 1 <= x <= n.
$a^5 + b^5 = c^5 + d ^ 5$
I first thought about using a heap, because it is what I am learning, but I can't seem to come up with a pattern.
I was told that my algorithm should run in $O(n^2\log(n))$ so I know I would have to use a heap of size n, with n*2 inserts into its structure.
That's as far as I got, can someone hint me?