Minimize Global Replacements to Make Values Contiguous
Company: Amazon
Role: Software Engineer
Category: Coding & Algorithms
Difficulty: medium
Interview Round: Online Assessment
Overview: Find the fewest global value-replacement operations needed so every remaining value occupies one contiguous block, accounting for compressed runs and replacements that affect all occurrences at once.