Skip to content

Commit 83cab8d

Browse files
authored
Update 1608-special-array-with-x-elements-greater-than-or-equal-x.js
1 parent 9b0e2bc commit 83cab8d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

1608-special-array-with-x-elements-greater-than-or-equal-x.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,7 @@ const specialArray = function(nums) {
2626
if(mid < nums[mid]) left = mid + 1
2727
else right = mid - 1
2828
}
29+
// if we found i == nums[i], there will be i + 1 items
30+
// larger or equal to i, which makes array not special.
2931
return left < nums.length && left === nums[left] ? -1 : left
3032
};

0 commit comments

Comments
 (0)