leetcode 4sum refactoring