Solution to 3 Sum problem