mirror of
https://github.com/youngyangyang04/leetcode-master.git
synced 2025-07-11 04:54:51 +08:00
@ -181,7 +181,7 @@ class Solution:
|
|||||||
# 统计除第一个字符串外字符的出现频率
|
# 统计除第一个字符串外字符的出现频率
|
||||||
for i in range(1, len(words)):
|
for i in range(1, len(words)):
|
||||||
hashOtherStr = [0] * 26
|
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
|
hashOtherStr[ord(words[i][j]) - ord('a')] += 1
|
||||||
# 更新hash,保证hash里统计26个字符在所有字符串里出现的最小次数
|
# 更新hash,保证hash里统计26个字符在所有字符串里出现的最小次数
|
||||||
for k in range(26):
|
for k in range(26):
|
||||||
|
Reference in New Issue
Block a user