Minimum Insertions to Make List a Subsequence (Amazon Germany :)

Problem Overview

  • Determine the minimum insertions needed into initialList so it becomes a subsequence of finalList.
  • Inputs: two integer lists; finalList has unique integers, initialList may contain duplicates; output: an integer count of operations.
  • Operation: insert any positive integer at any position in initialList; zero or more times.
  • Real-world context: sequence alignment and data pipeline normalization.
  • From Amazon Germany interviews; a coding interview problem and interview question.

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Input Variables
Execution Result: