看板
[ Python ]
討論串[問題]算法 k distinct letters
共 2 篇文章
首頁
上一頁
1
下一頁
尾頁
內容預覽:
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個字)
內容預覽:
https://imgur.com/a/2GAU3. my solution. https://repl.it/@shih_hsuanhsu/KDistinctCharacter. def KDistinctCharacter3. def KDistinctCharacter2. 兩個方法應該都正確
(還有36個字)
首頁
上一頁
1
下一頁
尾頁