LeetCode_String
文章平均质量分 64
想当厨子的程序媛
前期追深度,否则会华而不实,后期追广度,否则会坐井观天;
展开
-
Leetcode——557. Reverse Words in a String III
题目原址https://leetcode.com/problems/reverse-words-in-a-string-iii/description/题目描述Given a string, you need to reverse the order of characters in each word within a sentence while still preserving ...原创 2018-02-25 15:42:09 · 253 阅读 · 0 评论 -
Leetcode——537. Complex Number Multiplication
题目原址https://leetcode.com/problems/complex-number-multiplication/description/题目描述Given two strings representing two complex numbers. You need to return a string representing their multiplicati...原创 2018-05-28 15:39:07 · 183 阅读 · 0 评论 -
Leetcode——6. ZigZag Conversion
题目原址https://leetcode.com/problems/zigzag-conversion/description/题目描述The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display thi...原创 2018-06-04 20:31:01 · 229 阅读 · 0 评论 -
Leetcode——71. Simplify Path
题目原址https://leetcode.com/problems/simplify-path/description/题目描述Given an absolute path for a file (Unix-style), simplify it. For example, path = “/home/”, => “/home” path = “/a/./b/...原创 2018-06-04 20:57:31 · 206 阅读 · 0 评论 -
Leetcode——5. Longest Palindromic Substring(最长回文子串)
题目原址https://leetcode.com/problems/longest-palindromic-substring/description/AC代码class Solution { public String longestPalindrome(String s) { if(s == null || s.length() <= 1) ...原创 2018-06-04 21:33:39 · 136 阅读 · 0 评论 -
Leetcode——553. Optimal Division
题目原址https://leetcode.com/problems/optimal-division/description/题目描述Given a list of positive integers, the adjacent integers will perform the float division. For example, [2,3,4] -> 2 / 3 / ...原创 2018-05-30 18:46:09 · 347 阅读 · 0 评论 -
Leetcode——22. Generate Parentheses
题目原址https://leetcode.com/problems/generate-parentheses/description/题目描述Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For example, give...原创 2018-05-30 19:21:50 · 190 阅读 · 0 评论 -
Leetcode——539. Minimum Time Difference
题目原址https://leetcode.com/problems/minimum-time-difference/description/题目描述Given a list of 24-hour clock time points in “Hour:Minutes” format, find the minimum minutes difference between any two ...原创 2018-05-30 20:40:42 · 342 阅读 · 0 评论 -
Leetcode——583. Delete Operation for Two Strings
题目原址https://leetcode.com/problems/delete-operation-for-two-strings/description/题目描述Given two words word1 and word2, find the minimum number of steps required to make word1 and word2 the same, ...原创 2018-05-30 21:11:18 · 164 阅读 · 0 评论 -
Leetcode——767. Reorganize String
题目原址https://leetcode.com/problems/reorganize-string/description/题目描述Given a string S, check if the letters can be rearranged so that two characters that are adjacent to each other are not the ...原创 2018-05-31 09:08:13 · 1339 阅读 · 0 评论 -
Leetcode——522. Longest Uncommon Subsequence II
题目原址https://leetcode.com/problems/longest-uncommon-subsequence-ii/description/题目描述这个题。。理解起来。。。我觉得比较费劲。。。 给定一个字符串数组,返回这个字符串数组中最长非公共字串的长度。这里需要注意,非公共字串只能是一个情况就是比较整个字符串本身是否是另一个字符串的子串,如果是,这个字符串就不能...原创 2018-05-31 09:42:31 · 384 阅读 · 0 评论 -
Leetcode——227. Basic Calculator II
题目原址https://leetcode.com/problems/basic-calculator-ii/description/题目描述Implement a basic calculator to evaluate a simple expression string. The expression string contains only non-negative int...原创 2018-05-31 10:48:54 · 192 阅读 · 0 评论 -
Leetcode——678. Valid Parenthesis String(匹配括号)
题目原址https://leetcode.com/problems/valid-parenthesis-string/description/题目描述给定一个字符串,字符串中可以有(、)、*左括号,有括号和星号,星号可以表示左括号或右括号或空字符。返回该字符串是否可以左右括号完全匹配。AC代码示例一: 递归class Solution { public bool...原创 2018-05-31 11:21:41 · 412 阅读 · 0 评论 -
Leetcode——722. Remove Comments
题目原址https://leetcode.com/problems/remove-comments/description/题目描述给定一段代码段,其中包括注释部分,注释分为两种个://和/* */,现要求将代码段中的注释部分删除返回只有有效代码部分如:输入source = ["/*Test program */", "int main()", "{ ", " // var...原创 2018-06-01 15:59:22 · 861 阅读 · 0 评论 -
Leetcode——551. Student Attendance Record I
题目原址https://leetcode.com/problems/student-attendance-record-i/description/题目描述You are given a string representing an attendance record for a student. The record only contains the following three...原创 2018-04-24 21:45:00 · 147 阅读 · 0 评论 -
Leetcode——680. Valid Palindrome II
题目原址https://leetcode.com/problems/valid-palindrome-ii/description/题目描述Given a non-empty string s, you may delete at most one character. Judge whether you can make it a palindrome.Example1: ...原创 2018-04-24 21:24:52 · 279 阅读 · 0 评论 -
Leetcode——521. Longest Uncommon Subsequence I
题目原址https://leetcode.com/problems/longest-uncommon-subsequence-i/description/题目描述Given a group of two strings, you need to find the longest uncommon subsequence of this group of two strings. The...原创 2018-03-23 10:29:35 · 173 阅读 · 0 评论 -
Leetcode——520. Detect Capital
题目原址https://leetcode.com/problems/detect-capital/description/题目描述Given a word, you need to judge whether the usage of capitals in it is right or not. We define the usage of capitals in a wor...原创 2018-03-23 10:40:39 · 174 阅读 · 0 评论 -
Leetcode——788. Rotated Digits
题目原址https://leetcode.com/problems/rotated-digits/description/题目描述X is a good number if after rotating each digit individually by 180 degrees, we get a valid number that is different from X. Eac...原创 2018-03-23 11:26:49 · 793 阅读 · 0 评论 -
Leetcode——696. Count Binary Substrings
题目原址https://leetcode.com/problems/count-binary-substrings/description/题目描述Give a string s, count the number of non-empty (contiguous) substrings that have the same number of 0’s and 1’s, and all...原创 2018-03-23 12:02:21 · 339 阅读 · 0 评论 -
LeetCode—— 13. Roman to Integer
题目原址https://leetcode.com/problems/roman-to-integer/description/题目描述Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 to 3999.解题思路罗马数字一共有7个字母...原创 2018-03-23 13:12:47 · 173 阅读 · 0 评论 -
Leetcode——383. Ransom Note
题目原址https://leetcode.com/problems/ransom-note/description/题目描述Given an arbitrary ransom note string and another string containing letters from all the magazines, write a function that will retur...原创 2018-03-23 13:40:34 · 222 阅读 · 0 评论 -
Leetcode——387. First Unique Character in a String
题目原址https://leetcode.com/problems/first-unique-character-in-a-string/description/题目描述Given a string, find the first non-repeating character in it and return it’s index. If it doesn’t exist, retu...原创 2018-03-23 14:22:54 · 177 阅读 · 0 评论 -
Leetcode——459. Repeated Substring Pattern
题目原址https://leetcode.com/problems/repeated-substring-pattern/description/题目描述Given a non-empty string check if it can be constructed by taking a substring of it and appending multiple copies of ...原创 2018-03-24 17:50:50 · 141 阅读 · 0 评论 -
Leetcode——434. Number of Segments in a String
题目原址https://leetcode.com/problems/number-of-segments-in-a-string/description/题目描述Count the number of segments in a string, where a segment is defined to be a contiguous sequence of non-space cha...原创 2018-03-24 18:54:32 · 179 阅读 · 0 评论 -
Leetcode——38. Count and Say
题目原址https://leetcode.com/problems/count-and-say/description/题目描述The count-and-say sequence is the sequence of integers with the first five terms as following: 1 11 21 1211 111221...原创 2018-03-24 19:35:14 · 193 阅读 · 0 评论 -
Leetcode——443. String Compression
题目原址https://leetcode.com/problems/string-compression/description/题目描述Given an array of characters, compress it in-place.The length after compression must always be smaller than or equal to t...原创 2018-04-24 16:58:21 · 851 阅读 · 0 评论 -
Leetcode——67. Add Binary
题目原址https://leetcode.com/problems/add-binary/description/题目描述Given two binary strings, return their sum (also a binary string).The input strings are both non-empty and contains only characters...原创 2018-04-24 19:35:22 · 146 阅读 · 0 评论 -
Leetcode——686. Repeated String Match
题目原址https://leetcode.com/problems/repeated-string-match/description/题目描述Given two strings A and B, find the minimum number of times A has to be repeated such that B is a substring of it. If no...原创 2018-04-24 20:37:44 · 206 阅读 · 0 评论 -
Leetcode——709. To Lower Case
题目原址https://leetcode.com/problems/to-lower-case/description/题目描述Implement function ToLowerCase() that has a string parameter str, and returns the same string in lowercase.Example 1: Inpu...原创 2018-08-20 21:13:02 · 440 阅读 · 0 评论