From 53f0df8c89b5603c5104bb176b2b6c659a589f15 Mon Sep 17 00:00:00 2001 From: zhysdhr <945886711@qq.com> Date: Sun, 18 Aug 2019 22:24:42 +0800 Subject: [PATCH] =?UTF-8?q?Update=20=E7=AC=AC=E4=B8=80=E4=B8=AA=E5=8F=AA?= =?UTF-8?q?=E5=87=BA=E7=8E=B0=E4=B8=80=E6=AC=A1=E7=9A=84=E5=AD=97=E7=AC=A6?= =?UTF-8?q?.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit blist 并不一定是按顺序的,可能blist中的i并不一定是alist中第一个出现一次的字符 --- ...\270\200\346\254\241\347\232\204\345\255\227\347\254\246.py" | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git "a/\345\211\221\346\214\207offer/\347\254\254\344\270\200\344\270\252\345\217\252\345\207\272\347\216\260\344\270\200\346\254\241\347\232\204\345\255\227\347\254\246.py" "b/\345\211\221\346\214\207offer/\347\254\254\344\270\200\344\270\252\345\217\252\345\207\272\347\216\260\344\270\200\346\254\241\347\232\204\345\255\227\347\254\246.py" index 1c2fb5d..baa7491 100644 --- "a/\345\211\221\346\214\207offer/\347\254\254\344\270\200\344\270\252\345\217\252\345\207\272\347\216\260\344\270\200\346\254\241\347\232\204\345\255\227\347\254\246.py" +++ "b/\345\211\221\346\214\207offer/\347\254\254\344\270\200\344\270\252\345\217\252\345\207\272\347\216\260\344\270\200\346\254\241\347\232\204\345\255\227\347\254\246.py" @@ -24,7 +24,7 @@ def FirstNotRepeatingChar(self, s): if i not in blist.keys(): blist[i] = 0 blist[i] += 1 - for i in blist: + for i in alist: if blist[i] == 1: # %d format: a number is required, not str ,i此时返回的是只出现一次的那个字符串是不符合题意的 # return i