Problems > Rank Transform > Editorial

Rank Transform — Solution & Editorial

Back to the Problem

Sort a deduplicated copy, map value → index+1, then translate the original list — coordinate compression.

Complexity: O(N log N)