1
2
3
4
5
6
|
class Solution:
def countWords(self, words1: List[str], words2: List[str]) -> int:
ans=0
for i in words1:
if i in words2 and words1.count(i)==1 and words2.count(i)==1:ans+=1
return ans
|
cs |
반응형
'python-algorithm' 카테고리의 다른 글
leetcode 1619. Mean of Array After Removing Some Elements (0) | 2022.03.23 |
---|---|
leetcode 349. Intersection of Two Arrays (0) | 2022.03.23 |
leetcode 852. Peak Index in a Mountain Array (0) | 2022.03.22 |
leetcode 1380. Lucky Numbers in a Matrix (0) | 2022.03.22 |
leetcode 1356. Sort Integers by The Number of 1 Bits (0) | 2022.03.22 |
댓글