1331. Rank Transform of an Array

Обновлено: 2024-03-12
1 мин
[]

Содержание

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]