2.135-分發糖果

1 def candy(ratings): 2 result=[1 for i in range(len(ratings))] 3 for i in range(len(ratings)-1): 4 if ratings[i]>ratings[i+1] and result[i]<=result[i+1]: 5 result[i]+=
相關文章
相關標籤/搜索