2856. Minimum Array Length After Pair Removals
You are given a 0-indexed sorted array of integers
nums
.You can perform the following operation any number of times:
- Choose two indices,
i
andj
, wherei < j
, such thatnums[i] < nums[j]
.- Then, remove the elements at indices
i
andj
fromnums
. The remaining elements retain their original order, and the array is re-indexed.Return an integer that denotes the minimum length of
nums
after performing the operation any number of times (including zero).
1 |
|