Find all Pythagorean triples (a, b, c) such that 1 <= a, b, c <= n satisfying a^2 = b^2 + c^2, optimizing the solution from O(n^3) down to O(n) or O(n^2).
You've read your 3 free write-ups
Sign up free to keep reading. Your account opens the first 10 questions of every company.