原文链接: https://leetcode-cn.com/problems/license-key-formatting 英文原文You are given a license key represented as a string s that consists of only alphanumeric characters and dashes. The string is separated into n + 1 groups by n dashes. You are also give…
标签详情
字符串 分类
原文链接: https://leetcode-cn.com/problems/zuma-game 英文原文You are playing a variation of the game Zuma. In this variation of Zuma, there is a single row of colored balls on a board, where each ball can be colored red 'R', yellow 'Y', blue 'B', green 'G', …
原文链接: https://leetcode-cn.com/problems/keyboard-row 英文原文Given an array of strings words, return the words that can be typed using letters of the alphabet on only one row of American keyboard like the image below. In the American keyboard: the first r…
原文链接: https://leetcode-cn.com/problems/freedom-trail 英文原文In the video game Fallout 4, the quest "Road to Freedom" requires players to reach a metal dial called the "Freedom Trail Ring" and use the dial to spell a specific keyword to open the door. Gi…
原文链接: https://leetcode-cn.com/problems/longest-palindromic-subsequence 英文原文Given a string s, find the longest palindromic subsequence's length in s. A subsequence is a sequence that can be derived from another sequence by deleting some or no elements…
原文链接: https://leetcode-cn.com/problems/detect-capital 英文原文We define the usage of capitals in a word to be right when one of the following cases holds: All letters in this word are capitals, like "USA". All letters in this word are not capitals, like …
原文链接: https://leetcode-cn.com/problems/longest-uncommon-subsequence-ii 英文原文Given an array of strings strs, return the length of the longest uncommon subsequence between them. If the longest uncommon subsequence does not exist, return -1. An uncommon …
原文链接: https://leetcode-cn.com/problems/longest-word-in-dictionary-through-deleting 英文原文Given a string s and a string array dictionary, return the longest string in the dictionary that can be formed by deleting some of the given string characters. If …
原文链接: https://leetcode-cn.com/problems/encode-and-decode-tinyurl 英文原文Note: This is a companion problem to the System Design problem: Design TinyURL. TinyURL is a URL shortening service where you enter a URL such as https://leetcode.com/problems/desig…
原文链接: https://leetcode-cn.com/problems/complex-number-multiplication 英文原文A complex number can be represented as a string on the form "real+imaginaryi" where: real is the real part and is an integer in the range [-100, 100]. imaginary is the imaginary…
原文链接: https://leetcode-cn.com/problems/minimum-time-difference 英文原文Given a list of 24-hour clock time points in "HH:MM" format, return the minimum minutes difference between any two time-points in the list. Example 1: Input: timePoints = ["23:59","00…
原文链接: https://leetcode-cn.com/problems/reverse-string-ii 英文原文Given a string s and an integer k, reverse the first k characters for every 2k characters counting from the start of the string. If there are fewer than k characters left, reverse all of th…
原文链接: https://leetcode-cn.com/problems/student-attendance-record-i 英文原文You are given a string s representing an attendance record for a student where each character signifies whether the student was absent, late, or present on that day. The record on…
原文链接: https://leetcode-cn.com/problems/next-greater-element-iii 英文原文Given a positive integer n, find the smallest integer which has exactly the same digits existing in the integer n and is greater in value than n. If no such positive integer exists, …
原文链接: https://leetcode-cn.com/problems/reverse-words-in-a-string-iii 英文原文Given a string s, reverse the order of characters in each word within a sentence while still preserving whitespace and initial word order. Example 1: Input: s = "Let's take Leet…
原文链接: https://leetcode-cn.com/problems/find-the-closest-palindrome 英文原文Given a string n representing an integer, return the closest integer (not including itself), which is a palindrome. If there is a tie, return the smaller one. The closest is defin…
原文链接: https://leetcode-cn.com/problems/permutation-in-string 英文原文Given two strings s1 and s2, return true if s2 contains a permutation of s1, or false otherwise. In other words, return true if one of s1's permutations is the substring of s2. Example …
原文链接: https://leetcode-cn.com/problems/delete-operation-for-two-strings 英文原文Given two strings word1 and word2, return the minimum number of steps required to make word1 and word2 the same. In one step, you can delete exactly one character in either s…
原文链接: https://leetcode-cn.com/problems/tag-validator 英文原文Given a string representing a code snippet, implement a tag validator to parse the code and return whether it is valid. A code snippet is valid if all the following rules hold: The code must be…
原文链接: https://leetcode-cn.com/problems/minimum-index-sum-of-two-lists 英文原文Suppose Andy and Doris want to choose a restaurant for dinner, and they both have a list of favorite restaurants represented by strings. You need to help them find out their co…
原文链接: https://leetcode-cn.com/problems/construct-string-from-binary-tree 英文原文Given the root of a binary tree, construct a string consisting of parenthesis and integers from a binary tree with the preorder traversal way, and return it. Omit all the em…
原文链接: https://leetcode-cn.com/problems/find-duplicate-file-in-system 英文原文Given a list paths of directory info, including the directory path, and all the files with contents in this directory, return all the duplicate files in the file system in terms…
原文链接: https://leetcode-cn.com/problems/decode-ways-ii 英文原文A message containing letters from A-Z can be encoded into numbers using the following mapping: 'A' -> "1" 'B' -> "2" ... 'Z' -> "26" To decode an encoded message, all the digits must be groupe…
原文链接: https://leetcode-cn.com/problems/solve-the-equation 英文原文Solve a given equation and return the value of 'x' in the form of a string "x=#value". The equation contains only '+', '-' operation, the variable 'x' and its coefficient. You should retur…
原文链接: https://leetcode-cn.com/problems/palindromic-substrings 英文原文Given a string s, return the number of palindromic substrings in it. A string is a palindrome when it reads the same backward as forward. A substring is a contiguous sequence of charac…
原文链接: https://leetcode-cn.com/problems/replace-words 英文原文In English, we have a concept called root, which can be followed by some other word to form another longer word - let's call this word successor. For example, when the root "an" is followed by …
原文链接: https://leetcode-cn.com/problems/robot-return-to-origin 英文原文There is a robot starting at the position (0, 0), the origin, on a 2D plane. Given a sequence of its moves, judge if this robot ends up at (0, 0) after it completes its moves. You are …
原文链接: https://leetcode-cn.com/problems/strange-printer 英文原文There is a strange printer with the following two special properties: The printer can only print a sequence of the same character each time. At each turn, the printer can print new characters…
原文链接: https://leetcode-cn.com/problems/implement-magic-dictionary 英文原文Design a data structure that is initialized with a list of different words. Provided a string, you should determine if you can change exactly one character in this string to match …
原文链接: https://leetcode-cn.com/problems/map-sum-pairs 英文原文Design a map that allows you to do the following: Maps a string key to a given value. Returns the sum of the values that have a key with a prefix equal to a given string. Implement the MapSum c…