2020 第 11 周 LeetCode 记录

Yiran at 
1370. Increasing Decreasing String 链接到标题 题目描述很复杂,但其实就是排序和字典,先顺序遍历再反向遍历。(熟练使用 Counter)Python 链接到标题 class Solution(object): def sortString(self, s): """ :type s: str :rtype: str """ set_s = set() for c in s: set_s.add(c) characters = sorted(set_s) d = collections.Counter(s) res = "" while sum(d.values……