diff --git a/LeetCode/1608_Special_Array_With_X_Elements_Greater_Than_or_Equal_x.py b/LeetCode/1608_Special_Array_With_X_Elements_Greater_Than_or_Equal_x.py new file mode 100644 index 0000000..630f5cd --- /dev/null +++ b/LeetCode/1608_Special_Array_With_X_Elements_Greater_Than_or_Equal_x.py @@ -0,0 +1,14 @@ +class Solution(object): + def specialArray(self, nums): + """ + :type nums: List[int] + :rtype: int + """ + nums.sort() + out = -1 + for i in range(len(nums)): + if nums[~i]>=i+1: + if i==len(nums)-1 or nums[~(i+1)]