You are given an integer array nums of length pre containing unique integers.
In one operation, you can choose any integer pre and reverse the prefix of nums of length
Return the minimum number of operations required to sort nums in ascending order. If it is impossible to sort nums, return
Constraints:
nums.length
nums[i]
pre.length
pre[i]
nums is a permutation of integers from
pre consists of unique integers.
You are given an integer array nums of length pre containing unique integers.
In one operation, you can choose any integer pre and reverse the prefix of nums of length
Return the minimum number of operations required to sort nums in ascending order. If it is impossible to sort nums, return
Constraints:
nums.length
nums[i]
pre.length
pre[i]
nums is a permutation of integers from
pre consists of unique integers.