
双指针
景行cmy
这个作者很懒,什么都没留下…
展开
-
leetcode 214. Shortest Palindrome
Given a strings, you are allowed to convert it to a palindrome by adding characters in front of it. Find and return the shortest palindrome you can find by performing this transformation.Example 1:...原创 2019-07-20 17:46:19 · 100 阅读 · 0 评论 -
leetcode 828. Unique Letter String
A character is unique in stringSif it occurs exactly once in it.For example, in stringS = "LETTER", the only unique characters are"L"and"R".Let's defineUNIQ(S)as the number of unique chara...原创 2019-08-26 21:00:53 · 234 阅读 · 0 评论 -
leetcode 632. Smallest Range
You haveklists of sorted integers in ascending order. Find thesmallestrange that includes at least one number from each of theklists.We define the range [a,b] is smaller than range [c,d] ifb-...原创 2019-07-19 17:20:55 · 136 阅读 · 0 评论 -
leetcode 992. Subarrays with K Different Integers
Given an arrayAof positive integers, call a (contiguous, not necessarily distinct) subarray ofAgoodif the number of different integers in that subarray is exactlyK.(For example,[1,2,3,1,2]ha...原创 2019-09-02 11:18:52 · 193 阅读 · 0 评论 -
leetcode 340. Longest Substring with At Most K Distinct Characters
Given a string, find the length of the longest substring T that contains at most k distinct characters.Example 1:Input: s = "eceba", k = 2Output: 3Explanation: T is "ece" which its length is 3....原创 2019-10-03 16:09:57 · 128 阅读 · 0 评论