Minimum Steps to Rearrange Layers

Company: Expedia_22_dec

Difficulty: medium

Problem Statement

Minimum Steps to Rearrange Layers body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; line-height: 1.6; color: #333; max-width: 800px; margin: 20px auto; padding: 0 20px; } h1, h2 { border-bottom: 1px solid #eaecef; padding-bottom: 0.3em; } code { font-family: Consolas, Menlo, Courier, monospace; background-color: #f6f8fa; padding: 0.2em 0.4em; font-size: 85%; border-radius: 3px; } pre { background-color: #f6f8fa; padding: 16px; overflow: auto; border-radius: 3px; } table { border-collapse: collapse; } th, td { border: 1px solid #dfe2e5; padding: 6px 13px; } strong { font-weight: 600; } Minimum Steps to Rearrange Layers Problem Description Two lists of integers, current and desired , each give the order of the same n layers within a neural network architecture. During training you may repeatedly perform one operation. In one step you select the layer at the end of current and insert it back at any position in the list. Determine the