Available question text
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.
Related questions
Continue with questions that share topics or the same question type.
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 1331. Rank Transform of an Array
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source