![](https://img-blog.csdnimg.cn/20190918140053667.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
leetcode字符串
leetcode字符串
Bryan要加油
这个作者很懒,什么都没留下…
展开
-
165. Compare Version Numbers[Medium](Leetcode每日一题-2021.09.01)
ProblemGiven two version numbers, version1 and version2, compare them.Version numbers consist of one or more revisions joined by a dot ‘.’. Each revision consists of digits and may contain leading zeros. Every revision contains at least one character. Re原创 2021-09-01 20:32:35 · 259 阅读 · 0 评论 -
443. String Compression[Medium](Leetcode每日一题-2021.08.21)
Problem原创 2021-08-24 22:02:13 · 180 阅读 · 0 评论 -
541. Reverse String II[Easy](Leetcode每日一题-2021.08.20)
Problem原创 2021-08-24 22:01:12 · 138 阅读 · 0 评论 -
345. Reverse Vowels of a String[Easy](Leetcode每日一题-2021.08.19)
Problem原创 2021-08-24 21:56:45 · 272 阅读 · 0 评论 -
551. Student Attendance Record I[Easy](Leetcode每日一题-2021.08.17)
ProblemYou are given a string s representing an attendance record for a student where each character signifies whether the student was absent, late, or present on that day. The record only contains the following three characters:‘A’: Absent.‘L’: Late.原创 2021-08-17 20:14:06 · 229 阅读 · 0 评论 -
1736. Latest Time by Replacing Hidden Digits[Easy](Leetcode每日一题-2021.07.24)
Problem原创 2021-07-26 19:42:03 · 431 阅读 · 0 评论 -
168. Excel Sheet Column Title[Easy](Leetcode每日一题-2021.06.29)
ProblemGiven an integer columnNumber, return its corresponding column title as it appears in an Excel sheet.Constraints:1 <= columnNumber <= 231 - 1Example1Input: columnNumber = 1Output: “A”Example2Input: columnNumber = 28Output: “AB”原创 2021-06-29 22:20:57 · 189 阅读 · 0 评论 -
65. Valid Number[Hard](Leetcode每日一题-2021.06.17)--抄答案
ProblemA valid number can be split up into these components (in order):A decimal number or an integer.(Optional) An ‘e’ or ‘E’, followed by an integer.A decimal number can be split up into these components (in order):(Optional) A sign character (ei原创 2021-06-17 08:24:46 · 176 阅读 · 0 评论 -
13.Roman to Integer[Easy](Leetcode每日一题-2021.05.15)
ProblemRoman numerals are represented by seven different symbols: I, V, X, L, C, D and M.For example, 2 is written as II in Roman numeral, just two one’s added together. 12 is written as XII, which is simply X + II. The number 27 is written as XXVII, wh原创 2021-05-15 15:55:12 · 587 阅读 · 0 评论 -
12. Integer to Roman[Medium](Leetcode每日一题-2021.05.14)--抄答案
ProblemRoman numerals are represented by seven different symbols: I, V, X, L, C, D and M.For example, 2 is written as II in Roman numeral, just two one’s added together. 12 is written as XII, which is simply X + II. The number 27 is written as XXVII, wh原创 2021-05-14 21:55:34 · 656 阅读 · 0 评论 -
28. Implement strStr()(Leetcode每日一题-2021.04.20)--抄答案
ProblemImplement strStr().Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.Clarification:What should we return when needle is an empty string? This is a great question to ask during an interview.F原创 2021-04-20 08:38:20 · 321 阅读 · 0 评论 -
1370. Increasing Decreasing String(Leetcode每日一题-2020.11.25)
ProblemGiven a string s. You should re-order the string using the following algorithm:Pick the smallest character from s and append it to the result.Pick the smallest character from s which is greater than the last appended character to the result and原创 2020-11-25 20:15:17 · 164 阅读 · 0 评论 -
925. Long Pressed Name(Leetcode每日一题-2020.10.21)
ProblemYour friend is typing his name into a keyboard. Sometimes, when typing a character c, the key might get long pressed, and the character will be typed 1 or more times.You examine the typed characters of the keyboard. Return True if it is possible原创 2020-10-21 19:32:49 · 340 阅读 · 0 评论 -
65. Valid Number&&剑指 Offer 20. 表示数值的字符串(Leetcode每日一题-2020.09.02)
Problem请实现一个函数用来判断字符串是否表示数值(包括整数和小数)。例如,字符串"+100"、“5e2”、"-123"、“3.1416”、"-1E-16"、“0123"都表示数值,但"12e”、“1a3.14”、“1.2.3”、"±5"及"12e+5.4"都不是。Solutionclass Solution {public: bool isNumber(string s) { int l = 0, r = s.size() - 1; //去掉首尾的空格原创 2020-09-02 21:49:49 · 150 阅读 · 0 评论 -
557. Reverse Words in a String III(Leetcode每日一题-2020.08.30)
ProblemGiven a string, you need to reverse the order of characters in each word within a sentence while still preserving whitespace and initial word order.Note: In the string, each word is separated by single space and there will not be any extra space i原创 2020-08-30 08:07:16 · 318 阅读 · 0 评论 -
214. Shortest Palindrome(Leetcode每日一题-2020.08.29)
ProblemGiven a string s, 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.Example1Input: “aacecaaa”Output: “aaacecaaa”Example2原创 2020-08-29 21:00:24 · 194 阅读 · 0 评论 -
657. Robot Return to Origin(Leetcode每日一题-2020.08.28)
ProblemThere is a robot starting at position (0, 0), the origin, on a 2D plane. Given a sequence of its moves, judge if this robot ends up at (0, 0) after it completes its moves.The move sequence is represented by a string, and the character moves[i] rep原创 2020-08-28 20:36:29 · 135 阅读 · 0 评论 -
459. Repeated Substring Pattern(Leetcode每日一题-2020.08.24)
ProblemGiven a non-empty string check if it can be constructed by taking a substring of it and appending multiple copies of the substring together. You may assume the given string consists of lowercase English letters only and its length will not exceed 1原创 2020-08-24 21:58:47 · 179 阅读 · 0 评论 -
647. Palindromic Substrings(Leetcode每日一题-2020.08.19)
ProblemGiven a string, your task is to count how many palindromic substrings in this string.The substrings with different start indexes or end indexes are counted as different substrings even they consist of same characters.Note:The input string lengt原创 2020-08-19 21:58:55 · 178 阅读 · 0 评论 -
43. Multiply Strings(Leetcode每日一题-2020.08.13)
ProblemGiven two non-negative integers num1 and num2 represented as strings, return the product of num1 and num2, also represented as a string.Note:The length of both num1 and num2 is < 110.Both num1 and num2 contain only digits 0-9.Both num1 and原创 2020-08-13 21:53:23 · 137 阅读 · 0 评论 -
696. Count Binary Substrings(Leetcode每日一题-2020.08.10)--抄答案
ProblemGive a string s, count the number of non-empty (contiguous) substrings that have the same number of 0’s and 1’s, and all the 0’s and all the 1’s in these substrings are grouped consecutively.Substrings that occur multiple times are counted the num原创 2020-08-10 21:23:57 · 179 阅读 · 0 评论 -
415. Add Strings(Leetcode每日一题-2020.08.03)
ProblemGiven two non-negative integers num1 and num2 represented as string, return the sum of num1 and num2.Note:The length of both num1 and num2 is < 5100.Both num1 and num2 contains only digits 0-9.Both num1 and num2 does not contain any leading原创 2020-08-04 22:32:35 · 193 阅读 · 0 评论 -
67. Add Binary(Leetcode每日一题-2020.06.23)
ProblemGiven two binary strings, return their sum (also a binary string).The input strings are both non-empty and contains only characters 1 or 0.Constraints:Each string consists only of ‘0’ or ‘1’ characters.1 <= a.length, b.length <= 10^4Eac原创 2020-06-23 21:43:05 · 261 阅读 · 0 评论 -
面试题 16.18. Pattern Matching LCCI(Leetcode每日一题-2020.06.22)
ProblemYou are given two strings, pattern and value. The pattern string consists of just the letters a and b, describing a pattern within a string. For example, the string catcatgocatgo matches the pattern aabab (where cat is a and go is b). It also match原创 2020-06-22 22:39:03 · 254 阅读 · 0 评论 -
125. Valid Palindrome(Leetcode每日一题-2020.06.19)
ProblemGiven a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.Note: For the purpose of this problem, we define empty string as valid palindrome.Example1Input: “A man, a plan, a canal: Panama”Outpu原创 2020-06-19 21:54:52 · 167 阅读 · 0 评论 -
14. Longest Common Prefix(Leetcode每日一题-2020.06.15)
ProblemWrite a function to find the longest common prefix string amongst an array of strings.If there is no common prefix, return an empty string “”.All given inputs are in lowercase letters a-z.Example1Input: [“flower”,“flow”,“flight”]Output: “fl”原创 2020-06-15 19:26:26 · 171 阅读 · 0 评论 -
1371. Find the Longest Substring Containing Vowels in Even Counts(Leetcode每日一题-2020.05.20)
ProblemGiven the string s, return the size of the longest substring containing each vowel an even number of times. That is, ‘a’, ‘e’, ‘i’, ‘o’, and ‘u’ must appear an even number of times.Example1Input: s = “eleetminicoworoep”Output: 13Explanation: T原创 2020-05-20 21:05:12 · 251 阅读 · 0 评论 -
680. Valid Palindrome II(Leetcode每日一题-2020.05.19)
ProblemGiven a non-empty string s, you may delete at most one character. Judge whether you can make it a palindrome.Example1Input: “aba”Output: TrueExample2Input: “abca”Output: TrueExplanation: You could delete the character ‘c’.Solution双指针起原创 2020-05-19 20:38:59 · 183 阅读 · 0 评论 -
466. Count The Repetitions(Leetcode每日一题-2020.04.19)
占坑没有思路原创 2020-04-19 18:54:45 · 208 阅读 · 0 评论 -
151. Reverse Words in a String(Leetcode每日一题-2020.04.10)
ProblemGiven an input string, reverse the string word by word.Example1Input: “the sky is blue”Output: “blue is sky the”Example2Input: " hello world! "Output: “world! hello”Explanation: Yo...原创 2020-04-10 22:23:24 · 455 阅读 · 0 评论 -
72. Edit Distance(Leetcode每日一题-2020.04.06)
ProblemGiven two words word1 and word2, find the minimum number of operations required to convert word1 to word2.You have the following 3 operations permitted on a word:Insert a characterDelete a...原创 2020-04-06 15:25:05 · 218 阅读 · 0 评论 -
8. String to Integer (atoi)(Leetcode每日一题-2020.04.03)
ProblemImplement atoi which converts a string to an integer.The function first discards as many whitespace characters as necessary until the first non-whitespace character is found. Then, starting f...原创 2020-04-03 20:43:14 · 211 阅读 · 0 评论 -
面试题 01.09. String Rotation LCCI
ProblemGiven two strings, s1 and s2, write code to check if s2 is a rotation of s1 (e.g.,“waterbottle” is a rotation of"erbottlewat"). Can you use only one call to the method that checks if one word ...原创 2020-03-24 23:48:20 · 220 阅读 · 0 评论 -
面试题 01.04. Palindrome Permutation LCCI
ProblemGiven a string, write a function to check if it is a permutation of a palin drome. A palindrome is a word or phrase that is the same forwards and backwards. A permutation is a rearrangement o...原创 2020-03-24 23:34:12 · 214 阅读 · 0 评论 -
面试题 01.03. String to URL LCCI
ProblemWrite a method to replace all spaces in a string with ‘%20’. You may assume that the string has sufficient space at the end to hold the additional characters,and that you are given the “true” ...原创 2020-03-24 23:27:32 · 157 阅读 · 0 评论 -
409. Longest Palindrome(Leetcode每日一题-2020.03.19)
ProblemGiven a string which consists of lowercase or uppercase letters, find the length of the longest palindromes that can be built with those letters.This is case sensitive, for example “Aa” is no...原创 2020-03-19 20:04:14 · 162 阅读 · 0 评论 -
1160. Find Words That Can Be Formed by Characters(Leetcode每日一题-2020.03.17)
ProblemYou are given an array of strings words and a string chars.A string is good if it can be formed by characters from chars (each character can only be used once).Return the sum of lengths of a...原创 2020-03-17 19:55:19 · 212 阅读 · 0 评论 -
面试题 01.06. Compress String LCCI(Leetcode每日一题-2020.03.16)
ProblemImplement a method to perform basic string compression using the counts of repeated characters. For example, the string aabcccccaaa would become a2blc5a3. If the “compressed” string would not ...原创 2020-03-16 19:30:26 · 217 阅读 · 0 评论 -
1071. Greatest Common Divisor of Strings(Leetcode每日一题-2020.03.12)
ProblemFor strings S and T, we say “T divides S” if and only if S = T + … + T (T concatenated with itself 1 or more times)Return the largest string X such that X divides str1 and X divides str2.Ex...原创 2020-03-12 19:45:09 · 225 阅读 · 0 评论