5 leetcode
===========
第一道
1893
总之,之前的思路偏了,想岔了,还和主旨偏离了,导致总有奇奇怪怪的corner case没有顾及到
这次,用1 mark起点,-1 mark 终止的起点,然后,从1开始积累,直到看到-1,结束,每个element都这样,独自,互不干扰,最后是范围内的都是1,重叠部分可以是1++
第二道
1941
python的hash_map怎么遍历?
- for key in hash_map:
hash_map[key]
第三道
1897
- 1.compar=sorted(compar, key=len)
2.compar[1]=compar[1][:p]+compar[1][p+1:]
[Return true if you can make every string in words equal using any number of operations]
md 读错题了!
- for key,val in hash_tab.items():
第四道
1876
1.len(set(list(key)))
2.s[i:i+3]//i+3 取不到,有效size3的string是s[0:3]