Describe an algorithm to find pythagorean triplets given an array of n integers.
Anonymous
For every pair of numbers (a,b) in the array put a^2+b^2 into a hashmap. Iterate over the array again, for every element c check if c^2 is in the hashmap, if it is you found a tripplet. O(n^2) runtime.
Check out your Company Bowl for anonymous work chats.