Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 1331. Rank Transform of an Array
Replace each number by its rank among the distinct values (smallest value → rank 1, equal values share the same rank), effectively performing a coordinate-compression mapping from value to its sorted position. This yields an array of ranks preserving relative order while using ranks as small as possible.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.