Fetching data...
This may take a moment
Back
1416. Check if an Array Is Consecutive
Easy
Array
Hash Table
Sorting
Solve on LeetCode
View Solutions
Description
Hints
Hint 1
Try sorting nums.
Hint 2
If nums is consecutive and sorted in ascending order, then nums[i] + 1 = nums[i + 1] for every i in the range 0 ≤ i < nums.length - 1.
Similar Questions
Binary Tree Longest Consecutive Sequence
Medium
Binary Tree Longest Consecutive Sequence II
Medium
Consecutive Characters
Easy
Statistics
Acceptance
62.0%
Submissions
12,461
Accepted
7,723