Core Idea
Coordinate compression replaces large values with their rank among the distinct values. The relative order is preserved while the range becomes small.
Algorithm
Copy the values, sort them, remove duplicates, then binary search each original value in the distinct sorted list to find its compressed score.
Common Mistakes
Equal original values must receive the same compressed value. Decide from the statement whether ranks start at 0 or 1 and apply it consistently.