![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
string
文章平均质量分 77
ForABiggerWorld
这个作者很懒,什么都没留下…
展开
-
1392. Longest Happy Prefix
A string is called ahappy prefixif is anon-emptyprefix which is also a suffix (excluding itself).Given a strings. Return thelongest happy prefixofs.Return an empty string if no such prefi...原创 2020-03-25 22:45:35 · 293 阅读 · 0 评论 -
1370. Increasing Decreasing String
Given a strings. You should re-order the string using the following algorithm:Pick thesmallestcharacter fromsandappendit to the result. Pick thesmallestcharacter fromswhich is greater th...原创 2020-03-16 22:03:49 · 406 阅读 · 0 评论 -
1268. Search Suggestions System
Given an array of stringsproductsand a stringsearchWord. We want to design a system that suggests at most three product names fromproductsafter each character ofsearchWordis typed. Suggested pr...原创 2020-02-01 10:49:24 · 300 阅读 · 0 评论 -
1324. Print Words Vertically
Given a strings.Returnall the words vertically in the same order in which they appear ins.Words are returned as a list of strings, complete withspaces when is necessary. (Trailing spaces are not...原创 2020-01-25 21:07:48 · 327 阅读 · 0 评论 -
936. Stamping The Sequence
You want to form a target string of lowercase letters.At the beginning, your sequence is target.length '?' marks. You also have a stamp of lowercase letters.On each turn, you may place the stamp ...原创 2018-11-04 13:41:20 · 457 阅读 · 0 评论 -
906. Super Palindromes
Let's say a positive integer is a superpalindrome if it is a palindrome, and it is also the square of a palindrome.Now, given two positive integers L and R (represented as strings), return the numbe...原创 2018-09-16 11:24:17 · 387 阅读 · 0 评论 -
273. Integer to English Words
Convert a non-negative integer to its english words representation. Given input is guaranteed to be less than 231 - 1.Example 1:Input: 123Output: "One Hundred Twenty Three"Example 2:Input:...原创 2018-09-03 10:48:57 · 132 阅读 · 0 评论 -
224. Basic Calculator 227. Basic Calculator II
224. Basic Calculator Implement a basic calculator to evaluate a simple expression string.The expression string may contain open ( and closing parentheses ), the plus + or minus sign -, non-negati...原创 2016-12-31 17:12:43 · 358 阅读 · 0 评论 -
899. Orderly Queue
A string S of lowercase letters is given. Then, we may make any number of moves.In each move, we choose one of the first K letters (starting from the left), remove it, and place it at the end of th...原创 2018-09-02 11:33:35 · 278 阅读 · 0 评论 -
227. Basic Calculator II 224. Basic Calculator
你确定面试的时候用逆波兰表达式?? Implement a basic calculator to evaluate a simple expression string.The expression string may contain open ( and closing parentheses ), the plus + or minus sign -, non-negative...原创 2018-08-07 20:10:13 · 199 阅读 · 0 评论 -
884. Decoded String at Index
An encoded string S is given. To find and write the decoded string to a tape, the encoded string is read one character at a time and the following steps are taken:If the character read is a lett...原创 2018-08-05 11:53:45 · 621 阅读 · 0 评论 -
955. Delete Columns to Make Sorted II
We are given an array A of N lowercase letter strings, all of the same length.Now, we may choose any set of deletion indices, and for each string, we delete all the characters in those indices.For...原创 2018-12-09 14:01:38 · 427 阅读 · 0 评论 -
1003. Check If Word Is Valid After Substitutions
We are given that the string"abc"is valid.From any valid stringV, we may splitVinto two piecesXandYsuch thatX + Y(Xconcatenated withY) is equal toV. (XorYmay be empty.) Then,X + "...原创 2019-03-03 12:35:06 · 179 阅读 · 0 评论 -
1023. Binary String With Substrings Representing 1 To N
Given a binary stringS(a string consisting only of '0' and '1's) and a positive integerN, return true if and only if for every integer X from 1 to N, the binary representation of X is a substring o...原创 2019-03-24 12:07:13 · 170 阅读 · 0 评论 -
1071. Greatest Common Divisor of Strings
For stringsSandT, we say "TdividesS" if and only ifS = T + ... + T (Tconcatenated with itself 1 or more times)Return the largest stringXsuch thatXdividesstr1andXdividesstr2.Exa...原创 2019-06-02 13:34:12 · 514 阅读 · 0 评论 -
5086. Smallest Subsequence of Distinct Characters
Return the lexicographically smallest subsequence oftextthat contains all the distinct characters oftextexactly once.Example 1:Input: "cdadabcc"Output: "adbc"Example 2:Input: "abcd"...原创 2019-06-09 14:12:12 · 426 阅读 · 0 评论 -
1156. Swap For Longest Repeated Character Substring
Given a stringtext, we are allowed to swap two of the characters in the string. Find the length of the longest substring with repeated characters.Example 1:Input: text = "ababa"Output: 3Exp...原创 2019-08-11 12:37:39 · 449 阅读 · 0 评论 -
5069. Last Substring in Lexicographical Order
Given a strings, return the last substring ofsin lexicographical order.Example 1:Input: "abab"Output: "bab"Explanation: The substrings are ["a", "ab", "aba", "abab", "b", "ba", "bab"]. Th...原创 2019-08-18 12:22:10 · 359 阅读 · 0 评论 -
1177. Can Make Palindrome from Substring
Given a strings, we make queries on substrings ofs.For each queryqueries[i] = [left, right, k], we mayrearrangethe substrings[left], ..., s[right], and then chooseup tokof them to replace wi...原创 2019-09-01 14:56:16 · 380 阅读 · 0 评论 -
1178. Number of Valid Words for Each Puzzle
With respect to a givenpuzzlestring, awordisvalidif both the following conditions are satisfied:wordcontains the first letter ofpuzzle. For each letter inword, that letter is inpuzzle. F...原创 2019-09-01 14:58:59 · 495 阅读 · 0 评论 -
869. Reordered Power of 2
Starting with a positive integer N, we reorder the digits in any order (including the original order) such that the leading digit is not zero.Return true if and only if we can do this in a way such th...原创 2018-07-15 11:06:35 · 587 阅读 · 0 评论 -
867. Prime Palindrome
Find the smallest prime palindrome greater than or equal to N.Recall that a number is prime if it's only divisors are 1 and itself, and it is greater than 1. For example, 2,3,5,7,11 and 13 are primes....原创 2018-07-08 11:25:15 · 412 阅读 · 0 评论 -
761. Special Binary String
Special binary strings are binary strings with the following two properties:The number of 0's is equal to the number of 1's.Every prefix of the binary string has at least as many 1's as 0's.原创 2018-01-09 20:43:30 · 1065 阅读 · 0 评论 -
758. Bold Words in String
Given a set of keywords words and a string S, make all appearances of all keywords in S bold. Any letters between <b> and </b> tags become bold.The returned string should use the least num...原创 2018-01-08 21:27:57 · 644 阅读 · 0 评论 -
763. Partition Labels
A string S of lowercase letters is given. We want to partition this string into as many parts as possible so that each letter appears in at most one part, and return a list of integers representing原创 2018-01-14 16:00:44 · 297 阅读 · 0 评论 -
767. Reorganize String
Given a string S, check if the letters can be rearranged so that two characters that are adjacent to each other are not the same.If possible, output any possible result. If not possible, return原创 2018-01-21 13:21:19 · 809 阅读 · 0 评论 -
564. Find the Closest Palindrome
Given an integer n, find the closest integer (not including itself), which is a palindrome.The 'closest' is defined as absolute difference minimized between two integers.Example 1:Input: "123"原创 2017-09-14 10:57:55 · 338 阅读 · 0 评论 -
680. Valid Palindrome II
Given a non-empty string s, you may delete at most one character. Judge whether you can make it a palindrome.Example 1:Input: "aba"Output: TrueExample 2:Input: "abca"Output: T原创 2017-09-17 17:16:00 · 647 阅读 · 0 评论 -
678. Valid Parenthesis String
Given a string containing only three types of characters: '(', ')' and '*', write a function to check whether this string is valid. We define the validity of a string by these rules:Any left paren原创 2017-09-17 17:28:16 · 750 阅读 · 0 评论 -
730. Count Different Palindromic Subsequences
Given a string S, find the number of different non-empty palindromic subsequences in S, and return that number modulo 10^9 + 7.A subsequence of a string S is obtained by deleting 0 or more charac...原创 2017-11-26 12:03:06 · 353 阅读 · 0 评论 -
6. ZigZag Conversion
The 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)P A H NA P L S I原创 2018-01-20 17:00:45 · 146 阅读 · 0 评论 -
791. Custom Sort String
S and T are strings composed of lowercase letters. In S, no letter occurs more than once.S was sorted in some custom order previously. We want to permute the characters of T so that they match the ord...原创 2018-02-26 13:58:56 · 523 阅读 · 0 评论 -
318. Maximum Product of Word Lengths
Given a string array words, find the maximum value of length(word[i]) * length(word[j]) where the two words do not share common letters. You may assume that each word will contain only lower case lett...原创 2017-08-21 21:49:14 · 205 阅读 · 0 评论 -
843. Guess the Word
This problem is an interactive problem new to the LeetCode platform.We are given a word list of unique words, each word is 6 letters long, and one word in this list is chosen as secret.You may call ma...原创 2018-05-28 10:38:05 · 1762 阅读 · 0 评论 -
842. Split Array into Fibonacci Sequence
Given a string S of digits, such as S = "123456579", we can split it into a Fibonacci-like sequence [123, 456, 579].Formally, a Fibonacci-like sequence is a list F of non-negative integers such that:0...原创 2018-05-28 10:35:45 · 717 阅读 · 0 评论 -
838. Push Dominoes
There are N dominoes in a line, and we place each domino vertically upright.In the beginning, we simultaneously push some of the dominoes either to the left or to the right.After each second, each dom...原创 2018-05-20 11:27:42 · 696 阅读 · 0 评论 -
828. Unique Letter String
A character is unique in string S if it occurs exactly once in it.For example, in string S = "LETTER", the only unique characters are "L" and "R".Let's define UNIQ(S) as the number of unique character...原创 2018-05-06 11:47:11 · 655 阅读 · 0 评论 -
820. Short Encoding of Words
Given a list of words, we may encode it by writing a reference string S and a list of indexes A.For example, if the list of words is ["time", "me", "bell"], we can write it as S = "time#bell#" and ind...原创 2018-04-22 11:54:29 · 271 阅读 · 0 评论 -
800. Similar RGB Color
In the following, every capital letter represents some hexadecimal digit from 0 to f.The red-green-blue color "#AABBCC" can be written as "#ABC" in shorthand. For example, "#15c" is shorthand for the...原创 2018-03-18 11:52:58 · 1262 阅读 · 0 评论 -
792. Number of Matching Subsequences
Given string S and a dictionary of words words, find the number of words[i] that is a subsequence of S.Example :Input: S = "abcde"words = ["a", "bb", "acd", "ace"]Output: 3Explanation: There are ...原创 2018-03-04 13:19:33 · 675 阅读 · 0 评论