You are given an array of positive integers nums.
You need to select a subset of nums that can be arranged into a sequence of length
for some positive integer
Return the maximum number of elements in such a subset.
Note: A subset is a collection of elements obtained by deleting zero or more elements from an array without changing the relative order of the remaining elements.
Constraints:
nums.length
nums[i]
You are given an array of positive integers nums.
You need to select a subset of nums that can be arranged into a sequence of length
for some positive integer
Return the maximum number of elements in such a subset.
Note: A subset is a collection of elements obtained by deleting zero or more elements from an array without changing the relative order of the remaining elements.
Constraints:
nums.length
nums[i]