原文链接: https://leetcode-cn.com/problems/delete-columns-to-make-sorted 英文原文You are given an array of n strings strs, all of the same length. The strings can be arranged such that there is one on each line, making a grid. For example, strs = ["abc", "bc…
标签详情
字符串 分类
原文链接: https://leetcode-cn.com/problems/largest-time-for-given-digits 英文原文Given an array arr of 4 digits, find the latest 24-hour time that can be made using each digit exactly once. 24-hour times are formatted as "HH:MM", where HH is between 00 and 2…
原文链接: https://leetcode-cn.com/problems/verifying-an-alien-dictionary 英文原文In an alien language, surprisingly, they also use English lowercase letters, but possibly in a different order. The order of the alphabet is some permutation of lowercase letter…
原文链接: https://leetcode-cn.com/problems/delete-columns-to-make-sorted-ii 英文原文You are given an array of n strings strs, all of the same length. We may choose any deletion indices, and we delete all the characters in those indices for each string. For e…
原文链接: https://leetcode-cn.com/problems/delete-columns-to-make-sorted-iii 英文原文You are given an array of n strings strs, all of the same length. We may choose any deletion indices, and we delete all the characters in those indices for each string. For …
原文链接: https://leetcode-cn.com/problems/vowel-spellchecker 英文原文Given a wordlist, we want to implement a spellchecker that converts a query word into a correct word. For a given query word, the spell checker handles two categories of spelling mistakes:…
原文链接: https://leetcode-cn.com/problems/equal-rational-numbers 英文原文Given two strings s and t, each of which represents a non-negative rational number, return true if and only if they represent the same number. The strings may use parentheses to denote…
原文链接: https://leetcode-cn.com/problems/time-based-key-value-store 英文原文Design a time-based key-value data structure that can store multiple values for the same key at different time stamps and retrieve the key's value at a certain timestamp. Implement…
原文链接: https://leetcode-cn.com/problems/string-without-aaa-or-bbb 英文原文Given two integers a and b, return any string s such that: s has length a + b and contains exactly a 'a' letters, and exactly b 'b' letters, The substring 'aaa' does not occur in s,…
原文链接: https://leetcode-cn.com/problems/smallest-string-starting-from-leaf 英文原文You are given the root of a binary tree where each node has a value in the range [0, 25] representing the letters 'a' to 'z'. Return the lexicographically smallest string t…
原文链接: https://leetcode-cn.com/problems/satisfiability-of-equality-equations 英文原文You are given an array of strings equations that represent relationships between variables where each string equations[i] is of length 4 and takes one of two different fo…
原文链接: https://leetcode-cn.com/problems/find-common-characters 英文原文Given a string array words, return an array of all characters that show up in all strings within the words (including duplicates). You may return the answer in any order. Example 1: In…
原文链接: https://leetcode-cn.com/problems/check-if-word-is-valid-after-substitutions 英文原文Given a string s, determine if it is valid. A string s is valid if, starting with an empty string t = "", you can transform t into s after performing the following …
原文链接: https://leetcode-cn.com/problems/binary-string-with-substrings-representing-1-to-n 英文原文Given a binary string s and a positive integer n, return true if the binary representation of all the integers in the range [1, n] are substrings of s, or fa…
原文链接: https://leetcode-cn.com/problems/remove-outermost-parentheses 英文原文A valid parentheses string is either empty "", "(" + A + ")", or A + B, where A and B are valid parentheses strings, and + represents string concatenation. For example, "", "()",…
原文链接: https://leetcode-cn.com/problems/recover-a-tree-from-preorder-traversal 英文原文We run a preorder depth-first search (DFS) on the root of a binary tree. At each node in this traversal, we output D dashes (where D is the depth of this node), then we…
原文链接: https://leetcode-cn.com/problems/stream-of-characters 英文原文Design an algorithm that accepts a stream of characters and checks if a suffix of these characters is a string of a given array of strings words. For example, if words = ["abc", "xyz"] a…
原文链接: https://leetcode-cn.com/problems/find-words-that-can-be-formed-by-characters 英文原文You are given an array of strings words and a string chars. A string is good if it can be formed by characters from chars (each character can only be used once). R…
原文链接: https://leetcode-cn.com/problems/robot-bounded-in-circle 英文原文On an infinite plane, a robot initially stands at (0, 0) and faces north. The robot can receive one of three instructions: "G": go straight 1 unit; "L": turn 90 degrees to the left; "…
原文链接: https://leetcode-cn.com/problems/longest-duplicate-substring 英文原文Given a string s, consider all duplicated substrings: (contiguous) substrings of s that occur 2 or more times. The occurrences may overlap. Return any duplicated substring that ha…
原文链接: https://leetcode-cn.com/problems/remove-all-adjacent-duplicates-in-string 英文原文You are given a string s consisting of lowercase English letters. A duplicate removal consists of choosing two adjacent and equal letters and removing them. We repeat…
原文链接: https://leetcode-cn.com/problems/longest-string-chain 英文原文You are given an array of words where each word consists of lowercase English letters. wordA is a predecessor of wordB if and only if we can insert exactly one letter anywhere in wordA w…
原文链接: https://leetcode-cn.com/problems/last-substring-in-lexicographical-order 英文原文Given a string s, return the last substring of s in lexicographical order. Example 1: Input: s = "abab" Output: "bab" Explanation: The substrings are ["a", "ab", "aba"…
原文链接: https://leetcode-cn.com/problems/greatest-common-divisor-of-strings 英文原文For two strings s and t, we say "t divides s" if and only if s = t + ... + t (t concatenated with itself 1 or more times) Given two strings str1 and str2, return the larges…
原文链接: https://leetcode-cn.com/problems/occurrences-after-bigram 英文原文Given two strings first and second, consider occurrences in some text of the form "first second third", where second comes immediately after first, and third comes immediately after …
原文链接: https://leetcode-cn.com/problems/smallest-subsequence-of-distinct-characters 英文原文Given a string s, return the lexicographically smallest subsequence of s that contains all the distinct characters of s exactly once. Example 1: Input: s = "bcabc"…
原文链接: https://leetcode-cn.com/problems/shortest-common-supersequence 英文原文Given two strings str1 and str2, return the shortest string that has both str1 and str2 as subsequences. If there are multiple valid strings, return any of them. A string s is a…
原文链接: https://leetcode-cn.com/problems/brace-expansion-ii 中文题目如果你熟悉 Shell 编程,那么一定了解过花括号展开,它可以用来生成任意字符串。 花括号展开的表达式可以看作一个由 花括号、逗号 和 小写英文字母 组成的字符串,定义下面几条语法规则: 如果只给出单一的元素 x,那么表达式表示的字符串就只有 "x"。R(x) = {x} <ul> <li>例如,表达式 <code>"a"</code> 表示字符串 <c…
原文链接: https://leetcode-cn.com/problems/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)", ev…
原文链接: https://leetcode-cn.com/problems/defanging-an-ip-address 英文原文Given a valid (IPv4) IP address, return a defanged version of that IP address. A defanged IP address replaces every period "." with "[.]". Example 1: Input: address = "1.1.1.1" Output…