From fe872c09ec950e1cd951bc836099a074c6e1c945 Mon Sep 17 00:00:00 2001 From: sree_gaya3 Date: Sat, 10 Oct 2020 21:34:16 +0530 Subject: [PATCH 1/3] Solution to Problem 1608 issue #571 --- ...rray_With_X_Elements_Greater_Than_or_Equal_x.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 1608_Special_Array_With_X_Elements_Greater_Than_or_Equal_x.py diff --git a/1608_Special_Array_With_X_Elements_Greater_Than_or_Equal_x.py b/1608_Special_Array_With_X_Elements_Greater_Than_or_Equal_x.py new file mode 100644 index 0000000..630f5cd --- /dev/null +++ b/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)] Date: Sat, 10 Oct 2020 21:41:38 +0530 Subject: [PATCH 2/3] Added Solution to the Problem 1608 issue #571 --- ...rray_With_X_Elements_Greater_Than_or_Equal_x.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 LeetCode/1608_Special_Array_With_X_Elements_Greater_Than_or_Equal_x.py 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)] Date: Sat, 10 Oct 2020 21:44:03 +0530 Subject: [PATCH 3/3] Removed one wrong file with a typo --- ...rray_With_X_Elements_Greater_Than_or_Equal_x.py | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 1608_Special_Array_With_X_Elements_Greater_Than_or_Equal_x.py diff --git a/1608_Special_Array_With_X_Elements_Greater_Than_or_Equal_x.py b/1608_Special_Array_With_X_Elements_Greater_Than_or_Equal_x.py deleted file mode 100644 index 630f5cd..0000000 --- a/1608_Special_Array_With_X_Elements_Greater_Than_or_Equal_x.py +++ /dev/null @@ -1,14 +0,0 @@ -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)]