1
2
3
4
5
6
|
class Solution:
def findLucky(self, arr: List[int]) -> int:
ans=-1
for i in arr:
if i>ans and arr.count(i)==i :ans=i
return ans
|
cs |
반응형
'python-algorithm' 카테고리의 다른 글
leetcode 217. Contains Duplicate (0) | 2022.03.24 |
---|---|
leetcode 389. Find the Difference (0) | 2022.03.24 |
leetcode 1491. Average Salary Excluding the Minimum and Maximum Salary (0) | 2022.03.24 |
leetcode 1991. Find the Middle Index in Array (0) | 2022.03.24 |
leetcode 1619. Mean of Array After Removing Some Elements (0) | 2022.03.23 |
댓글