Leetcode-Question-159: Longest Substring with At Most Two Distinct Characters

Original Link:

https://leetcode.com/problems/longest-substring-with-at-most-two-distinct-characters/

Description:

Given a string, find the length of the longest substring T that contains at most 2 distinct characters.

For example, Given s = “eceba”,

T is “ece” which its length is 3.

Solution:

Sliding Window

2017.10.13 方法

 

发表评论

电子邮件地址不会被公开。 必填项已用*标注