Minimize Replacements So Equal Product Values Are Contiguous
Company: Amazon
Role: Software Engineer
Category: Coding & Algorithms
Difficulty: hard
Interview Round: Onsite
Quick Answer: Minimize the replacement cost needed so every remaining product value occupies one contiguous block, where one operation changes all occurrences of one value into another. The challenge tests compression of repeated runs, global merge effects, weighted decisions, and scalable reasoning for arrays with up to 200,000 entries.