今際の国の呵呵君
Tuesday, September 18, 2018
[LeetCode]Fruit Into Baskets
这道题本质上和
Longest Substring with At Most Two Distinct Chars
是一模一样的。我们用双指针sliding window即可解决。时间复杂度O(N),代码如下:
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment