Advertisement
DeepRest

4Sum II

Feb 3rd, 2022
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.24 KB | None | 0 0
  1. class Solution:
  2.     def fourSumCount(self, nums1: List[int], nums2: List[int], nums3: List[int], nums4: List[int]) -> int:
  3.         mp = Counter(i+j for j in nums2 for i in nums1)
  4.         return sum(mp[-x-y] for y in nums4 for x in nums3)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement