rewrite the 3Sum problem