solution for 3 sum