1331. Rank Transform of an Array

Updated: 2024-03-12
1 min read
[]

On This Page

LeetCode problem 1331

class Solution:
    def arrayRankTransform(self, arr: List[int]) -> List[int]:
        t = sorted(set(arr))
        return [bisect_right(t, x) for x in arr]