Tap here to switch tabs
Problem
Submissions

Problem: Split and Merge Array Transformation

Try to solve the Split and Merge Array Transformation problem.

Statement

You are given two integer arrays nums1 and nums2 of length n, where nums2 is a permutation of nums1.

In one operation, you can choose any contiguous subarray of nums1, extract it, and insert it at any position within the remaining elements.

Return the minimum number of operations required to transform nums1 into nums2.

Constraints:

  • 2≤2 \leq n ==== nums1.length ==== nums2.length ≤6\leq 6

  • −105≤-10^5 \leq nums1[i], nums2[i] ≤105\leq 10^5

  • nums2 is a permutation of nums1.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Split and Merge Array Transformation

Try to solve the Split and Merge Array Transformation problem.

Statement

You are given two integer arrays nums1 and nums2 of length n, where nums2 is a permutation of nums1.

In one operation, you can choose any contiguous subarray of nums1, extract it, and insert it at any position within the remaining elements.

Return the minimum number of operations required to transform nums1 into nums2.

Constraints:

  • 2≤2 \leq n ==== nums1.length ==== nums2.length ≤6\leq 6

  • −105≤-10^5 \leq nums1[i], nums2[i] ≤105\leq 10^5

  • nums2 is a permutation of nums1.