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,
iandj, wherei < j, such thatnums[i] < nums[j].- Then, remove the elements at indices
iandjfromnums. The remaining elements retain their original order, and the array is re-indexed.Return an integer that denotes the minimum length of
numsafter performing the operation any number of times (including zero).
1 |
|