原文链接: https://leetcode-cn.com/problems/maximum-nesting-depth-of-two-valid-parentheses-strings 英文原文A string is a valid parentheses string (denoted VPS) if and only if it consists of "(" and ")" characters only, and: It is the empty string, or It can b…
标签详情
字符串 分类
原文链接: https://leetcode-cn.com/problems/iterator-for-combination 英文原文Design the CombinationIterator class: CombinationIterator(string characters, int combinationLength) Initializes the object with a string characters of sorted distinct lowercase Engli…
原文链接: https://leetcode-cn.com/problems/distinct-echo-substrings 英文原文Return the number of distinct non-empty substrings of text that can be written as the concatenation of some string with itself (i.e. it can be written as a + a where a is some string…
原文链接: https://leetcode-cn.com/problems/longest-common-subsequence 英文原文Given two strings text1 and text2, return the length of their longest common subsequence. If there is no common subsequence, return 0. A subsequence of a string is a new string gen…
原文链接: https://leetcode-cn.com/problems/longest-chunked-palindrome-decomposition 英文原文You are given a string text. You should split it to k substrings (subtext1, subtext2, ..., subtextk) such that: subtexti is a non-empty string. The concatenation of a…
原文链接: https://leetcode-cn.com/problems/break-a-palindrome 英文原文Given a palindromic string of lowercase English letters palindrome, replace exactly one character with any lowercase English letter so that the resulting string is not a palindrome and tha…
原文链接: https://leetcode-cn.com/problems/day-of-the-year 英文原文Given a string date representing a Gregorian calendar date formatted as YYYY-MM-DD, return the day number of the year. Example 1: Input: date = "2019-01-09" Output: 9 Explanation: Given date …
原文链接: https://leetcode-cn.com/problems/swap-for-longest-repeated-character-substring 英文原文You are given a string text. You can swap two of the characters in the text. Return the length of the longest substring with repeated characters. Example 1: Inpu…
原文链接: https://leetcode-cn.com/problems/maximum-number-of-words-you-can-type 英文原文There is a malfunctioning keyboard where some letter keys do not work. All other keys on the keyboard work properly. Given a string text of words separated by a single sp…
原文链接: https://leetcode-cn.com/problems/compare-strings-by-frequency-of-the-smallest-character 英文原文Let the function f(s) be the frequency of the lexicographically smallest character in a non-empty string s. For example, if s = "dcce" then f(s) = 2 bec…
原文链接: https://leetcode-cn.com/problems/number-of-days-between-two-dates 英文原文Write a program to count the number of days between two dates. The two dates are given as strings, their format is YYYY-MM-DD as shown in the examples. Example 1: Input: date…
原文链接: https://leetcode-cn.com/problems/can-make-palindrome-from-substring 英文原文You are given a string s and array queries where queries[i] = [lefti, righti, ki]. We may rearrange the substring s[lefti...righti] for each query and then choose up to ki …
原文链接: https://leetcode-cn.com/problems/number-of-valid-words-for-each-puzzle 英文原文With respect to a given puzzle string, a word is valid if both the following conditions are satisfied: word contains the first letter of puzzle. For each letter in word,…
原文链接: https://leetcode-cn.com/problems/maximum-number-of-balloons 英文原文Given a string text, you want to use the characters of text to form as many instances of the word "balloon" as possible. You can use each character in text at most once. Return the…
原文链接: https://leetcode-cn.com/problems/reverse-substrings-between-each-pair-of-parentheses 英文原文You are given a string s that consists of lower case English letters and brackets. Reverse the strings in each pair of matching parentheses, starting from …
原文链接: https://leetcode-cn.com/problems/delete-characters-to-make-fancy-string 英文原文A fancy string is a string where no three consecutive characters are equal. Given a string s, delete the minimum possible number of characters from s to make it fancy. …
原文链接: https://leetcode-cn.com/problems/longest-happy-string 英文原文A string is called happy if it does not have any of the strings 'aaa', 'bbb' or 'ccc' as a substring. Given three integers a, b and c, return any string s, which satisfies following cond…
原文链接: https://leetcode-cn.com/problems/smallest-string-with-swaps 英文原文You are given a string s, and an array of pairs of indices in the string pairs where pairs[i] = [a, b] indicates 2 indices(0-indexed) of the string. You can swap the characters at …
原文链接: https://leetcode-cn.com/problems/get-equal-substrings-within-budget 英文原文You are given two strings s and t of the same length. You want to change s to t. Changing the i-th character of s to i-th character of t costs |s[i] - t[i]| that is, the ab…
原文链接: https://leetcode-cn.com/problems/maximum-product-of-the-length-of-two-palindromic-substrings 英文原文You are given a 0-indexed string s and are tasked with finding two non-intersecting palindromic substrings of odd length such that the product of t…
原文链接: https://leetcode-cn.com/problems/split-a-string-in-balanced-strings 英文原文Balanced strings are those that have an equal quantity of 'L' and 'R' characters. Given a balanced string s, split it in the maximum amount of balanced strings. Return the …
原文链接: https://leetcode-cn.com/problems/replace-the-substring-for-balanced-string 英文原文You are given a string containing only 4 kinds of characters 'Q', 'W', 'E' and 'R'. A string is said to be balanced if each of its characters appears n/4 times where…
原文链接: https://leetcode-cn.com/problems/remove-sub-folders-from-the-filesystem 英文原文Given a list of folders folder, return the folders after removing all sub-folders in those folders. You may return the answer in any order. If a folder[i] is located wi…
原文链接: https://leetcode-cn.com/problems/maximum-length-of-a-concatenated-string-with-unique-characters 英文原文You are given an array of strings arr. A string s is formed by the concatenation of a subsequence of arr that has unique characters. Return the …
原文链接: https://leetcode-cn.com/problems/minimum-swaps-to-make-strings-equal 英文原文You are given two strings s1 and s2 of equal length consisting of letters "x" and "y" only. Your task is to make these two strings equal to each other. You can swap any tw…
原文链接: https://leetcode-cn.com/problems/minimum-remove-to-make-valid-parentheses 英文原文Given a string s of '(' , ')' and lowercase English characters. Your task is to remove the minimum number of parentheses ( '(' or ')', in any positions ) so that the …
原文链接: https://leetcode-cn.com/problems/maximum-score-words-formed-by-letters 英文原文Given a list of words, list of single letters (might be repeating) and score of every character. Return the maximum score of any valid set of words formed by using the g…
原文链接: https://leetcode-cn.com/problems/search-suggestions-system 英文原文Given an array of strings products and a string searchWord. We want to design a system that suggests at most three product names from products after each character of searchWord is …
原文链接: https://leetcode-cn.com/problems/palindrome-partitioning-iii 英文原文You are given a string s containing lowercase letters and an integer k. You need to : First, change some characters of s to other lowercase English letters. Then divide s into k n…
原文链接: https://leetcode-cn.com/problems/maximum-number-of-occurrences-of-a-substring 英文原文Given a string s, return the maximum number of ocurrences of any substring under the following rules: The number of unique characters in the substring must be les…