You are given two integer arrays current and desired, both of length n, representing two orderings of the same n neural network layers.
Starting from the arrangement current, you may repeatedly perform the following operation: Remove the last layer of the array and insert it at any position in the remaining array, including the beginning or the end.
Return the minimum number of operations required to transform current into desired. It is guaranteed that desired is always reachable.
Ask AI Assistant

Ask AI Assistant
Ask me anything about this coding question!
Test Cases
Input
Output
Expected