} // 从每个单独的字符s[i]和(s[i], s[i+1])开始展开,求两侧的最长palindromestringlongestPalindromeSimple(strings) {intn = s.length();if(n == 0)return"";stringlongest = s.substr(0, 1);// a single char itself is a palindromefor(inti = 0; i < n-1; i++) {stringp1 = expand...
csharp go java javascript kotlin python 0001-two-sum.py 0002-add-two-numbers.py 0003-longest-substring-without-repeating-characters.py 0004-median-of-two-sorted-arrays.py 0005-longest-palindromic-substring.py 0007-reverse-integer.py 0010-regular-expression-matching.py 0011-...
0151-Reverse-Words-in-a-String 0152-Maximum-Product-Subarray 0153-Find-Minimum-in-Rotated-Sorted-Array 0155-Min-Stack 0159-Longest-Substring-with-At-Most-Two-Distinct-Characters 0160-Intersection-of-Two-Linked-Lists 0161-One-Edit-Distance 0167-Two-Sum-II-Input-array-is-sort...
Explanation: The substring with start index = 0 is "ab", which is an anagram of "ab". The substring with start index = 1 is "ba", which is an anagram of "ab". The substring with start index = 2 is "ab", which is an anagram of "ab". 题目标签:Hash Table 题目给了我们两个str...
How many bit strings of length 8 do not contain the substring 11? How many 10-digit binary strings have an even number of 1's? Find a non-recursive formula, indexed from i = 1, for the general term ai of each of the following sequences...
1858C-YetAnotherPermutationProblem.cpp 1859A-UnitedWeStand.cpp 1859B-OlyaAndGameWithArrays.cpp 1860A-NotASubstring.cpp 1860B-FancyCoins.cpp 1861A-PrimeDeletion.cpp 1861B-TwoBinaryStrings.cpp 1862A-GiftCarpet.cpp 1862B-SequenceGame.cpp 1862C-FlowerCityFence.cpp 1862D-IceCreamBalls.cpp 1862E-Kolya...
csharp dart go java javascript kotlin python ruby rust 0001-two-sum.rs 0002-add-two-numbers.rs 0003-longest-substring-without-repeating-characters.rs 0004-median-of-two-sorted-arrays.rs 0005-longest-palindromic-substring.rs 0007-reverse-integer.rs 0009-palindrome-number.rs 0011-container-with-most...