Skip to content

Commit 2fa11ef

Browse files
committed
added q1 special array
1 parent 07255ea commit 2fa11ef

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
class Solution:
3+
def specialArray(self, nums: List[int]) -> int:
4+
for i in range(1, len(nums)+1):
5+
count = 0
6+
for j in nums:
7+
if j >= i:
8+
count += 1
9+
if count == i:
10+
return i
11+
return -1

0 commit comments

Comments
 (0)