3Sum O(n^2)

time complexity is O(n^2), space complexity is O(1)