You are given an array nums of positive integers and an integer k.
In one operation, you can remove the last element of the array and add it to your collection.
Return the minimum number of operations required to collect all integers from k.
Constraints:
nums.length
nums[i] nums.length
k nums.length
The input is generated such that you can collect elements k.
You are given an array nums of positive integers and an integer k.
In one operation, you can remove the last element of the array and add it to your collection.
Return the minimum number of operations required to collect all integers from k.
Constraints:
nums.length
nums[i] nums.length
k nums.length
The input is generated such that you can collect elements k.