. - 力扣(LeetCode) 直接算就行 from typing import List class Solution: def findIntersectionValues(self, nums1: List[int], nums2: List[int]) -> List[int]: nums1_count = 0 nums2_count = 0 for item in nums1: if item in nums2: nums1_count += 1 for item in nums2: if item in nums1: nums2_count += 1 return [nums1_count, nums2_count]