原文链接: https://leetcode-cn.com/problems/minimum-possible-integer-after-at-most-k-adjacent-swaps-on-digits 英文原文Given a string num representing the digits of a very large integer and an integer k. You are allowed to swap any two adjacent digits of the i…
标签详情
字符串 分类
原文链接: https://leetcode-cn.com/problems/number-of-good-ways-to-split-a-string 英文原文You are given a string s, a split is called good if you can split s into 2 non-empty strings p and q where its concatenation is equal to s and the number of distinct let…
原文链接: https://leetcode-cn.com/problems/number-of-substrings-with-only-1s 英文原文Given a binary string s, return the number of substrings with all characters 1's. Since the answer may be too large, return it modulo 109 + 7. Example 1: Input: s = "0110111…
原文链接: https://leetcode-cn.com/problems/string-compression-ii 英文原文Run-length encoding is a string compression method that works by replacing consecutive identical characters (repeated 2 or more times) with the concatenation of the character and the nu…
原文链接: https://leetcode-cn.com/problems/maximum-number-of-non-overlapping-substrings 英文原文Given a string s of lowercase letters, you need to find the maximum number of non-empty substrings of s that meet the following conditions: The substrings do not …
原文链接: https://leetcode-cn.com/problems/can-convert-string-in-k-moves 英文原文Given two strings s and t, your goal is to convert s into t in k moves or less. During the ith (1 <= i <= k) move you can: Choose any index j (1-indexed) from s, such that 1 <= …
原文链接: https://leetcode-cn.com/problems/minimum-insertions-to-balance-a-parentheses-string 英文原文Given a parentheses string s containing only the characters '(' and ')'. A parentheses string is balanced if: Any left parenthesis '(' must have a correspon…
原文链接: https://leetcode-cn.com/problems/shuffle-string 英文原文Given a string s and an integer array indices of the same length. The string s will be shuffled such that the character at the ith position moves to indices[i] in the shuffled string. Return t…
原文链接: https://leetcode-cn.com/problems/bulb-switcher-iv 英文原文There is a room with n bulbs, numbered from 0 to n - 1, arranged in a row from left to right. Initially, all the bulbs are turned off. Your task is to obtain the configuration represented by…
原文链接: https://leetcode-cn.com/problems/thousand-separator 英文原文Given an integer n, add a dot (".") as the thousands separator and return it in string format. Example 1: Input: n = 987 Output: "987" Example 2: Input: n = 1234 Output: "1.234" Example 3:…
原文链接: https://leetcode-cn.com/problems/make-the-string-great 英文原文Given a string s of lower and upper case English letters. A good string is a string which doesn't have two adjacent characters s[i] and s[i + 1] where: 0 <= i <= s.length - 2 s[i] is a …
原文链接: https://leetcode-cn.com/problems/find-kth-bit-in-nth-binary-string 英文原文Given two positive integers n and k, the binary string Sn is formed as follows: S1 = "0" Si = Si-1 + "1" + reverse(invert(Si-1)) for i > 1 Where + denotes the concatenation …
原文链接: https://leetcode-cn.com/problems/find-longest-awesome-substring 英文原文Given a string s. An awesome substring is a non-empty substring of s such that we can make any number of swaps in order to make it palindrome. Return the length of the maximum …
原文链接: https://leetcode-cn.com/problems/number-of-ways-to-split-a-string 英文原文Given a binary string s (a string consisting only of '0's and '1's), we can split s into 3 non-empty strings s1, s2, s3 (s1+ s2+ s3 = s). Return the number of ways s can be s…
原文链接: https://leetcode-cn.com/problems/replace-all-s-to-avoid-consecutive-repeating-characters 英文原文Given a string s containing only lowercase English letters and the '?' character, convert all the '?' characters into lowercase letters such that the f…
原文链接: https://leetcode-cn.com/problems/minimum-deletion-cost-to-avoid-repeating-letters 英文原文Given a string s and an array of integers cost where cost[i] is the cost of deleting the ith character in s. Return the minimum cost of deletions such that th…
原文链接: https://leetcode-cn.com/problems/check-if-string-is-transformable-with-substring-sort-operations 英文原文Given two strings s and t, you want to transform string s into string t using the following operation any number of times: Choose a non-empty s…
原文链接: https://leetcode-cn.com/problems/alert-using-same-key-card-three-or-more-times-in-a-one-hour-period 英文原文LeetCode company workers use key-cards to unlock office doors. Each time a worker uses their key-card, the security system saves the worker'…
原文链接: https://leetcode-cn.com/problems/rearrange-spaces-between-words 英文原文You are given a string text of words that are placed among some number of spaces. Each word consists of one or more lowercase English letters and are separated by at least one …
原文链接: https://leetcode-cn.com/problems/split-a-string-into-the-max-number-of-unique-substrings 英文原文Given a string s, return the maximum number of unique substrings that the given string can be split into. You can split string s into any list of non-e…
原文链接: https://leetcode-cn.com/problems/crawler-log-folder 英文原文The Leetcode file system keeps a log each time some user performs a change folder operation. The operations are described below: "../" : Move to the parent folder of the current folder. (I…
原文链接: https://leetcode-cn.com/problems/maximum-nesting-depth-of-the-parentheses 英文原文A string is a valid parentheses string (denoted VPS) if it meets one of the following: It is an empty string "", or a single character not equal to "(" or ")", It can…
原文链接: https://leetcode-cn.com/problems/split-two-strings-to-make-palindrome 英文原文You are given two strings a and b of the same length. Choose an index and split both strings at the same index, splitting a into two strings: aprefix and asuffix where a …
原文链接: https://leetcode-cn.com/problems/count-substrings-that-differ-by-one-character 英文原文Given two strings s and t, find the number of ways you can choose a non-empty substring of s and replace a single character by a different character such that th…
原文链接: https://leetcode-cn.com/problems/number-of-ways-to-form-a-target-string-given-a-dictionary 英文原文You are given a list of strings of the same length words and a string target. Your task is to form target using the given words under the following r…
原文链接: https://leetcode-cn.com/problems/largest-substring-between-two-equal-characters 英文原文Given a string s, return the length of the longest substring between two equal characters, excluding the two characters. If there is no such substring return -1…
原文链接: https://leetcode-cn.com/problems/lexicographically-smallest-string-after-applying-operations 英文原文You are given a string s of even length consisting of digits from 0 to 9, and two integers a and b. You can apply either of the following two opera…
原文链接: https://leetcode-cn.com/problems/slowest-key 英文原文A newly designed keypad was tested, where a tester pressed a sequence of n keys, one at a time. You are given a string keysPressed of length n, where keysPressed[i] was the ith key pressed in the…
原文链接: https://leetcode-cn.com/problems/minimum-deletions-to-make-string-balanced 英文原文You are given a string s consisting only of characters 'a' and 'b'. You can delete any number of characters in s to make s balanced. s is balanced if there is no…
原文链接: https://leetcode-cn.com/problems/maximum-repeating-substring 英文原文For a string sequence, a string word is k-repeating if word concatenated k times is a substring of sequence. The word's maximum k-repeating value is the highest value k where word…