You are given an array target consisting of distinct integers and an integer array arr.
In a single operation, you can insert any integer at any position of arr. You may perform this operation any number of times.
Return the minimum number of operations required to make target a subsequence of arr.
Note: A subsequence of an array is a sequence derived by deleting zero or more elements from the array without altering the relative order of the remaining elements.
Constraints:
target.length, arr.length
target[i], arr[i]
target contains no duplicates.
You are given an array target consisting of distinct integers and an integer array arr.
In a single operation, you can insert any integer at any position of arr. You may perform this operation any number of times.
Return the minimum number of operations required to make target a subsequence of arr.
Note: A subsequence of an array is a sequence derived by deleting zero or more elements from the array without altering the relative order of the remaining elements.
Constraints:
target.length, arr.length
target[i], arr[i]
target contains no duplicates.