From 5b26e131e049c0f478929755f990ef7bfd765e01 Mon Sep 17 00:00:00 2001 From: Bryce S <44215173+GHumorBS@users.noreply.github.com> Date: Thu, 26 Aug 2021 11:46:26 +0800 Subject: [PATCH] =?UTF-8?q?Update=201002.=E6=9F=A5=E6=89=BE=E5=B8=B8?= =?UTF-8?q?=E7=94=A8=E5=AD=97=E7=AC=A6.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 这个python代码又有小问题,不知道为啥修改前虽然word[0]逻辑上完全讲不通,但是运行居然正确 --- problems/1002.查找常用字符.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/problems/1002.查找常用字符.md b/problems/1002.查找常用字符.md index a789373b..c165f985 100644 --- a/problems/1002.查找常用字符.md +++ b/problems/1002.查找常用字符.md @@ -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):