看板 [ Python ]
討論串[問題]算法 k distinct letters
共 2 篇文章
首頁
上一頁
1
下一頁
尾頁

推噓0(0推 0噓 0→)留言0則,0人參與, 最新作者cutekid時間7年前 (2018/03/13 17:45), 7年前編輯資訊
0
0
2
內容預覽:
def KDistinctCharacter(s,k):. ans = []. word = dict(). len = 0. i = 0. for ch in list(s):. if( ch in word and i - word[ch] < k ):. len = i - word[ch].
(還有234個字)

推噓1(1推 0噓 2→)留言3則,0人參與, 7年前最新作者suhang (suhang)時間7年前 (2018/03/13 07:10), 編輯資訊
0
0
2
內容預覽:
https://imgur.com/a/2GAU3. my solution. https://repl.it/@shih_hsuanhsu/KDistinctCharacter. def KDistinctCharacter3. def KDistinctCharacter2. 兩個方法應該都正確
(還有36個字)
首頁
上一頁
1
下一頁
尾頁