class Solution: def fourSum(self, nums: List[int], targ…