今際の国の呵呵君
Friday, October 27, 2017
[LeetCode]Longest Substring with At Most K Distinct Characters
和
Longest Substring with at Most Two Distinct Character
的题目是一样的。区别就是判断的时候从2个不同char变为k个不同的char即可。时间复杂度O(n),空间复杂度O(n),代码如下:
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment