classSolution:deffourSumCount(self,nums1: List[int],nums2: List[int],nums3: List[int],nums4: List[int]) ->int: dict1 ={}for i in nums1:for j in nums2:if i + j in dict1: dict1[i+j]+=1else: dict1[i+j]=1 res =0for m in nums3:for n in nums4:if-m-n in dict1: res += dict1[-m-n]return res