Given an array of integers nums, you are allowed to perform the following operation any number of times:
Your task is to find the minimum number of operations required to make the array empty.
Example 1:
Input: nums = [5,3,1,4,2]
Output: 3
Explanation:
We remove subsequences [1, 2], [3, 4], [5].
Example 2:
Input: nums = [1,2,3,4,5]
Output: 1
Example 3:
Input: nums = [5,4,3,2,1]
Output: 5
Constraints:
1 <= nums.length <= 1051 <= nums[i] <= 105Loading editor...
[5,3,1,4,2]