5531. 特殊数组的特征值
传送门
传送门
题意
结题思路
class Solution(object):
def specialArray(self
, nums
):
"""
:type nums: List[int]
:rtype: int
"""
len1
= len(nums
)
for i
in range(1, len1
+1):
count
= 0
for j
in range(len1
):
if(nums
[j
] >= i
):
count
+= 1
if(count
== i
):
return i
return -1
转载请注明原文地址:https://blackberry.8miu.com/read-9984.html