
字符串
景行cmy
这个作者很懒,什么都没留下…
展开
-
leetcode 772. Basic Calculator III
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 integers and empty sp...原创 2019-10-02 09:33:58 · 197 阅读 · 0 评论 -
leetcode 972. Equal Rational Numbers
Given two stringsSandT, each of which represents a non-negative rational number, returnTrueif and only if they represent the same number. The strings may use parentheses to denote the repeating p...原创 2019-09-27 10:49:53 · 201 阅读 · 0 评论 -
1163. Last Substring in Lexicographical Order
Given a string s, return the last substring of s in lexicographical order.Example 1:Input: "abab"Output: "bab"Explanation: The substrings are ["a", "ab", "aba", "abab", "b", "ba", "bab"]. Th...原创 2019-09-25 11:07:32 · 461 阅读 · 0 评论 -
leetcode 1106. Parsing A Boolean Expression
Return the result of evaluating a given boolean expression, represented as a string.An expression can either be:"t", evaluating to True; "f", evaluating to False; "!(expr)", evaluating to the lo...原创 2019-09-24 09:43:13 · 288 阅读 · 0 评论 -
leetcode 1096. Brace Expansion II
Under a grammar given below, strings can represent a set of lowercase words. Let'suse R(expr)to denote the set of words the expression represents.Grammar can best be understood through simple exa...原创 2019-09-23 21:08:33 · 1233 阅读 · 0 评论 -
leetcode 1044. Longest Duplicate Substring
Given a stringS, consider allduplicated substrings: (contiguous) substrings of S that occur 2 or more times. (The occurrencesmay overlap.)Returnanyduplicatedsubstring that has the longest pos...原创 2019-09-22 11:23:08 · 296 阅读 · 0 评论 -
leetcode 899. Orderly Queue
A string S of lowercase letters is given. Then, we may make any number of moves.In each move, wechoose oneof the first K letters (starting from the left), remove it,and place it at the end of th...原创 2019-09-16 12:01:32 · 246 阅读 · 0 评论 -
leetcode 761. Special Binary String
Specialbinary 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....原创 2019-08-20 21:31:53 · 205 阅读 · 0 评论 -
leetcode 753. Cracking the Safe
There is a box protected by a password. The password is a sequence ofndigitswhere each digit can be one of the firstkdigits0, 1, ..., k-1.While entering a password,the lastndigits entered wil...原创 2019-08-20 16:18:59 · 130 阅读 · 0 评论 -
leetcode 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"...原创 2019-07-23 10:18:49 · 105 阅读 · 0 评论 -
leetcode 214. Shortest Palindrome
Given a strings, 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.Example 1:...原创 2019-07-20 17:46:19 · 100 阅读 · 0 评论 -
leetcode 87. Scramble String
Given a strings1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.Below is one possible representation ofs1="great": great / \ gr ...转载 2019-07-20 13:19:09 · 311 阅读 · 0 评论 -
leetcode 68. Text Justification
Given an array of words and a widthmaxWidth, format the text such that each line has exactlymaxWidthcharacters and is fully (left and right) justified.You should pack your words in a greedy appro...原创 2019-07-20 10:45:57 · 91 阅读 · 0 评论 -
leetcode 32. Longest Valid Parentheses
Given a string containing just the characters'('and')', find the length of the longest valid (well-formed) parentheses substring.Example 1:Input: "(()"Output: 2Explanation: The longest valid...原创 2019-07-19 21:21:35 · 111 阅读 · 0 评论 -
leetcode 10 Regular Expression Matching
10.Regular Expression MatchingGiven an input string (s) and a pattern (p), implement regular expression matching with support for'.'and'*'.'.' Matches any single character.'*' Matches zero o...原创 2019-05-22 16:33:38 · 72 阅读 · 0 评论 -
212. Word Search II
212.Word Search IIHard107368FavoriteShareGiven a 2D board and a list of words from the dictionary, find all words in the board.Each word must be constructed from letters of sequentially adjac...原创 2019-05-22 16:32:37 · 258 阅读 · 0 评论 -
leetcode 97. Interleaving String c++
97.Interleaving StringHard72735FavoriteShareGivens1,s2,s3, find whethers3is formed by the interleaving ofs1ands2.Example 1:Input: s1 = "aabcc", s2 = "dbbca", s3 = "aadbbcbcac"Outp...原创 2019-05-06 18:50:45 · 178 阅读 · 0 评论 -
leetcode 72 Edit Distance c++
72.Edit DistanceHard197930FavoriteShareGiven two wordsword1andword2, find the minimum number of operations required to convertword1toword2.You have the following 3 operations permitted ...原创 2019-05-06 19:01:31 · 158 阅读 · 0 评论