python linkedhashset 簡單實現,使用OrderedDict

pokercc發表於2017-11-24
nums=[1,1,2,2,3]
from collections import OrderedDict
nums=list(OrderedDict.fromkeys(nums).keys())
assert nums==[1,2,3] ,'linkedhashset 實現失敗'複製程式碼

相關文章