Re: [閒聊] 每日leetcode

作者: DJYOSHITAKA (Evans)   2024-10-02 13:04:10
早早早
天氣這麼好該出去完唄
別捲了==
def arrayRankTransform(self, arr: List[int]) -> List[int]:
mp = {}
for i,val in enumerate(sorted(arr)):
if val not in mp:
mp[val] = len(mp)+1
ans = []
for num in arr:
ans.append(mp[num])
return ans
作者: JIWP (JIWP)   2024-10-02 13:05:00
卷三小
作者: sustainer123 (caster)   2024-10-02 13:05:00
卷三小
作者: argorok (s.green)   2024-10-02 13:05:00
卷三小

Links booklink

Contact Us: admin [ a t ] ucptt.com