Problem 3682 · Medium

Minimum Index Sum of Common Elements

Match values across two arrays by their first positions, then keep the values whose position sum is smallest.

Open the interactive visualisation