2229. Check if an Array Is Consecutive
Given an integer array
nums
, returntrue
ifnums
is consecutive, otherwise returnfalse
.An array is consecutive if it contains every number in the range
[x, x + n - 1]
(inclusive), wherex
is the minimum number in the array andn
is the length of the array.
1 | class Solution { |