原文:[LeetCode] 159. Longest Substring with At Most Two Distinct Characters 最多有两个不同字符的最长子串

Given a strings, find the length of the longest substringtthat containsat most distinct characters. Example : Example : 这道题给我们一个字符串,让求最多有两个不同字符的最长子串。那么首先想到的是用 HashMap 来做,HashMap 记录每个字符的出现次数,然后如果 Hash ...

2016-02-09 15:20 5 14603 推荐指数:

查看详情

 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM