![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
#String
TechJungle
这个作者很懒,什么都没留下…
展开
-
LeetCode String 32 Longest Valid Parentheses
32. Longest Valid ParenthesesGiven a string containing just the characters ‘(’ and ‘)’, find the length of the longest valid (well-formed) parentheses substring.Example 1:Input: “(()”Output: 2Exp...原创 2019-12-20 11:08:00 · 158 阅读 · 0 评论 -
LeetCode String 22 Generate Parentheses
22. Generate ParenthesesGiven n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, given n = 3, a solution set is:[“((()))”,“(()())”,“(()...原创 2019-12-20 01:13:19 · 101 阅读 · 0 评论 -
LeetCode String 20 Valid Parentheses
20. Valid ParenthesesGiven a string containing just the characters ‘(’, ‘)’, ‘{’, ‘}’, ‘[’ and ‘]’, determine if the input string is valid.An input string is valid if:Open brackets must be closed b...原创 2019-12-19 14:31:16 · 63 阅读 · 0 评论 -
LeetCode String 336 Palindrome Pairs
336. Palindrome PairsGiven a list of unique words, find all pairs of distinct indices (i, j) in the given list, so that the concatenation of the two words, i.e. words[i] + words[j] is a palindrome.E...原创 2019-12-19 14:05:45 · 116 阅读 · 0 评论 -
LeetCode String 5 Longest Palindromic Substring
5. Longest Palindromic SubstringGiven a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.Example 1:Input: “babad”Output: “bab”Note: “aba”...原创 2019-12-19 10:41:23 · 96 阅读 · 0 评论 -
LeetCode String 125 Valid Palindrome
125. Valid PalindromeGiven 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 val...原创 2019-12-19 08:46:24 · 82 阅读 · 0 评论 -
LeetCode String 76 Minimum Window Substring
76. Minimum Window SubstringGiven a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n).Example:Input: S = “ADOBECODEBANC”, T = “ABC”...原创 2019-12-19 07:24:51 · 66 阅读 · 0 评论 -
LeetCode String 65 Valid Number
65. Valid NumberValidate if a given string can be interpreted as a decimal number.Some examples:“0” => true" 0.1 " => true“abc” => false“1 a” => false“2e10” => true" -90e3 " =...原创 2019-12-19 05:34:12 · 76 阅读 · 0 评论 -
LeetCode String 68 Text Justification
68. Text JustificationGiven an array of words and a width maxWidth, format the text such that each line has exactly maxWidth characters and is fully (left and right) justified.You should pack your w...原创 2019-12-19 04:41:33 · 66 阅读 · 0 评论 -
LeetCode String 157 158 Read N Characters Given Read4 I and II
157. Read N Characters Given Read4Given a file and assume that you can only read the file using a given method read4, implement a method to read n characters.Method read4:The API read4 reads 4 cons...原创 2019-12-19 01:17:16 · 136 阅读 · 0 评论 -
LeetCode String 273 Integer to English Words
273. Integer to English WordsConvert a non-negative integer to its english words representation. Given input is guaranteed to be less than 2312^{31}231 - 1.Example 1:Input: 123Output: “One Hundred...原创 2019-12-18 09:18:35 · 88 阅读 · 0 评论 -
LeetCode String 12 Integer to Roman
12. Integer to RomanRoman numerals are represented by seven different symbols: I, V, X, L, C, D and M.Symbol ValueI 1V 5X 10L 50C ...原创 2019-12-18 08:57:22 · 76 阅读 · 0 评论 -
LeetCode String 13 Roman to Integer
13. Roman to IntegerRoman numerals are represented by seven different symbols: I, V, X, L, C, D and M.Symbol ValueI 1V 5X 10L 50C ...原创 2019-12-18 00:18:54 · 94 阅读 · 0 评论 -
LeetCode String 171 Excel Sheet Column Number
171. Excel Sheet Column NumberGiven a column title as appear in an Excel sheet, return its corresponding column number.For example:A -> 1B -> 2C -> 3...Z -> 26AA -> 27AB -> ...原创 2019-12-17 23:58:23 · 83 阅读 · 0 评论 -
LeetCode String 168 Excel Sheet Column Title
168. Excel Sheet Column TitleGiven a positive integer, return its corresponding column title as appear in an Excel sheet.For example:1 -> A2 -> B3 -> C…26 -> Z27 -> AA28 -> ...原创 2019-12-06 04:22:52 · 62 阅读 · 0 评论 -
LeetCode String 316 Remove Duplicate Letters
316. Remove Duplicate LettersGiven a string which contains only lowercase letters, remove duplicate letters so that every letter appears once and only once. You must make sure your result is the smal...原创 2019-12-06 03:52:26 · 85 阅读 · 0 评论 -
LeetCode String 38 Count and Say
38. Count and SayThe count-and-say sequence is the sequence of integers with the first five terms as following:1112112111112211 is read off as “one 1” or 11.11 is read off as ...原创 2019-12-01 12:46:49 · 76 阅读 · 0 评论 -
LeetCode String 161 One Edit Distance
161. One Edit DistanceGiven two strings s and t, determine if they are both one edit distance apart.Note:There are 3 possiblities to satisify one edit distance apart:Insert a character into s to g...原创 2019-12-01 11:32:43 · 97 阅读 · 0 评论 -
LeetCode String 6 ZigZag Conversion
6. ZigZag ConversionThe string “PAYPALISHIRING” is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility)And t...原创 2019-12-01 06:11:12 · 52 阅读 · 0 评论 -
LeetCode String 179 Largest Number
179. Largest NumberGiven a list of non negative integers, arrange them such that they form the largest number.Example 1:Input: [10,2]Output: “210”Example 2:Input: [3,30,34,5,9]Output: “9534330”...原创 2019-12-01 04:16:31 · 87 阅读 · 0 评论 -
LeetCode String 87 Scramble String
87. Scramble StringGiven a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.Below is one possible representation of s1 = “great”:To scramb...原创 2019-12-01 01:43:13 · 86 阅读 · 0 评论 -
LeetCode String 49 Group Anagrams
49. Group AnagramsGiven an array of strings, group anagrams together.Example:Input: [“eat”, “tea”, “tan”, “ate”, “nat”, “bat”],Output:[[“ate”,“eat”,“tea”],[“nat”,“tan”],[“bat”]]Note:All inp...原创 2019-11-30 02:55:50 · 83 阅读 · 0 评论 -
LeetCode String 242 Valid Anagram
242. Valid Anagram(相同字母异序词)Given two strings s and t , write a function to determine if t is an anagram of s.Example 1:Input: s = “anagram”, t = “nagaram”Output: trueExample 2:Input: s = “rat”, ...原创 2019-11-28 11:00:31 · 80 阅读 · 0 评论 -
LeetCode String 290 Word Pattern
290. Word PatternGiven a pattern and a string str, find if str follows the same pattern.Here follow means a full match, such that there is a bijection between a letter in pattern and a non-empty wor...原创 2019-11-28 04:11:03 · 74 阅读 · 0 评论 -
LeetCodeString 205 Isomorphic Strings
205. Isomorphic StringsGiven two strings s and t, determine if they are isomorphic.Two strings are isomorphic if the characters in s can be replaced to get t.All occurrences of a character must be ...原创 2019-11-28 03:42:25 · 69 阅读 · 0 评论 -
LeetCode String 345 Reverse Vowels of a String
345. Reverse Vowels of a StringWrite a function that takes a string as input and reverse only the vowels of a string.Example 1:Input: “hello”Output: “holle”Example 2:Input: “leetcode”Output: “l...原创 2019-11-21 14:04:20 · 83 阅读 · 0 评论 -
LeetCode String 151 Reverse Words in a String
151. Reverse Words in a StringGiven an input string, reverse the string word by word.Example 1:Input: “the sky is blue”Output: “blue is sky the”Example 2:Input: " hello world! "Output: “world...原创 2019-11-21 10:32:14 · 79 阅读 · 0 评论 -
LeetCode String 344 Reverse String
344. Reverse StringWrite a function that reverses a string. The input string is given as an array of characters char[].Do not allocate extra space for another array, you must do this by modifying th...原创 2019-11-21 10:27:38 · 55 阅读 · 0 评论 -
LeetCode String 383. Ransom Note
383. Ransom NoteGiven an arbitrary ransom note string and another string containing letters from all the magazines, write a function that will return true if the ransom note can be constructed from t...原创 2019-11-21 10:23:52 · 101 阅读 · 0 评论 -
LeetCode String 387 First Unique Character in a String
387. First Unique Character in a StringGiven a string, find the first non-repeating character in it and return it’s index. If it doesn’t exist, return -1.Examples:s = “leetcode”return 0.s = “lov...原创 2019-11-20 11:38:26 · 75 阅读 · 0 评论 -
LeetCode String 58 Length of Last Word
58. Length of Last WordGiven a string s consists of upper/lower-case alphabets and empty space characters ’ ', return the length of last word in the string.If the last word does not exist, return 0....原创 2019-11-20 11:07:09 · 92 阅读 · 0 评论 -
LeetCode String 14 Longest Common Prefix
14. Longest Common PrefixWrite a function to find the longest common prefix string amongst an array of strings.If there is no common prefix, return an empty string “”.Example 1:Input: [“flower”,“...原创 2019-11-20 10:49:28 · 55 阅读 · 0 评论 -
LeetCode String 28 Implement strStr()
28. Implement strStr()Implement strStr().Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.Example 1:Input: haystack = “hello”, needle = “ll”...原创 2019-11-19 13:18:42 · 71 阅读 · 0 评论 -
JAVA数据类型 String StringBuffer
1 basicsString is immutable. String buffers support mutable strings2 define and initialize2.1 as a char arraychar data[] = {‘a’, ‘b’, ‘c’};String str = new String(data);2.2 as a stringString st...原创 2019-11-19 06:00:10 · 147 阅读 · 0 评论