solution for 4sum problem