from operator import eq def count_same_pair(nums1, nums2): result = sum(map(eq, nums1, nums2)) return result