Update 1002.查找常用字符.md

这个python代码又有小问题,不知道为啥修改前虽然word[0]逻辑上完全讲不通,但是运行居然正确
This commit is contained in:
Bryce S
2021-08-26 11:46:26 +08:00
committed by GitHub
parent c8149ced78
commit 5b26e131e0

View File

@ -181,7 +181,7 @@ class Solution:
# 统计除第一个字符串外字符的出现频率
for i in range(1, len(words)):
hashOtherStr = [0] * 26
for j in range(len(words[0])):
for j in range(len(words[i])):
hashOtherStr[ord(words[i][j]) - ord('a')] += 1
# 更新hash保证hash里统计26个字符在所有字符串里出现的最小次数
for k in range(26):