rewrite leetcode 4sum