write O(n^3) solution for FourSum