重复字符筛查leetcode chaosxxxx124 我的GitHub个人资料的配置文件
重复字符筛查leetcode 2021.7.4 leetcode第一天,做了几道简单题,没啥说的检查是否有重复元素: if len(a)==len(set(a)) 2021.7.5第二天,主要收获是列表和整数、字符串的转换: lst = list(map(int,str(number))) number = "".join(map(list(str,lst)))两个列表的差集lst_diff = list(set(lst1)^set(lst2))跟出现次数有关的题:hashtable 2021.7.6第三天collections.Counter计数器正常情况下自己写计数器是这样写collections.Counter的写法: colors = ['red', 'blue', 'red', 'green', 'blue' from collections import Counter result = {} colors = ['red', 'blue', 'red', 'green', 'blue'] for color in colo
下载地址
用户评论