原文链接: https://leetcode-cn.com/problems/find-the-kth-largest-integer-in-the-array 英文原文You are given an array of strings nums and an integer k. Each string in nums represents an integer without leading zeros. Return the string that represents the kth l…
标签详情
字符串 分类
原文链接: https://leetcode-cn.com/problems/number-of-unique-good-subsequences 英文原文You are given a binary string binary. A subsequence of binary is considered good if it is not empty and has no leading zeros (with the exception of "0"). Find the number of…
原文链接: https://leetcode-cn.com/problems/reverse-prefix-of-word 英文原文Given a 0-indexed string word and a character ch, reverse the segment of word that starts at index 0 and ends at the index of the first occurrence of ch (inclusive). If the character c…
原文链接: https://leetcode-cn.com/problems/maximum-product-of-the-length-of-two-palindromic-subsequences 英文原文Given a string s, find two disjoint palindromic subsequences of s such that the product of their lengths is maximized. The two subsequences are d…
原文链接: https://leetcode-cn.com/problems/number-of-pairs-of-strings-with-concatenation-equal-to-target 英文原文Given an array of digit strings nums and a digit string target, return the number of pairs of indices (i, j) (where i != j) such that the concate…
原文链接: https://leetcode-cn.com/problems/maximize-the-confusion-of-an-exam 英文原文A teacher is writing a test with n true/false questions, with 'T' denoting true and 'F' denoting false. He wants to confuse the students by maximizing the number of consecut…
原文链接: https://leetcode-cn.com/problems/final-value-of-variable-after-performing-operations 英文原文There is a programming language with only four operations and one variable X: ++X and X++ increments the value of the variable X by 1. --X and X-- decremen…
原文链接: https://leetcode-cn.com/problems/longest-subsequence-repeated-k-times 英文原文You are given a string s of length n, and an integer k. You are tasked to find the longest subsequence repeated k times in string s. A subsequence is a string that can be…
原文链接: https://leetcode-cn.com/problems/remove-colored-pieces-if-both-neighbors-are-the-same-color 英文原文There are n pieces arranged in a line, and each piece is colored either by 'A' or by 'B'. You are given a string colors of length n where colors[i] …
原文链接: https://leetcode-cn.com/problems/minimum-moves-to-convert-string 英文原文You are given a string s consisting of n characters which are either 'X' or 'O'. A move is defined as selecting three consecutive characters of s and converting them to 'O'. N…
原文链接: https://leetcode-cn.com/problems/smallest-k-length-subsequence-with-occurrences-of-a-letter 英文原文You are given a string s, an integer k, a letter letter, and an integer repetition. Return the lexicographically smallest subsequence of s of length…
原文链接: https://leetcode-cn.com/problems/kth-distinct-string-in-an-array 英文原文A distinct string is a string that is present only once in an array. Given an array of strings arr, and an integer k, return the kth distinct string present in arr. If there a…
原文链接: https://leetcode-cn.com/problems/plates-between-candles 英文原文There is a long table with a line of plates and candles arranged on top of it. You are given a 0-indexed string s consisting of characters '*' and '|' only, where a '*' represents a pl…
原文链接: https://leetcode-cn.com/problems/number-of-valid-move-combinations-on-chessboard 英文原文There is an 8 x 8 chessboard containing n pieces (rooks, queens, or bishops). You are given a string array pieces of length n, where pieces[i] describes the ty…
原文链接: https://leetcode-cn.com/problems/check-if-numbers-are-ascending-in-a-sentence 英文原文A sentence is a list of tokens separated by a single space with no leading or trailing spaces. Every token is either a positive number consisting of digits 0-9 wi…
原文链接: https://leetcode-cn.com/problems/number-of-valid-words-in-a-sentence 英文原文A sentence consists of lowercase letters ('a' to 'z'), digits ('0' to '9'), hyphens ('-'), punctuation marks ('!', '.', and ','), and spaces (' ') only. Each sentence can …
原文链接: https://leetcode-cn.com/problems/check-whether-two-strings-are-almost-equivalent 英文原文Two strings word1 and word2 are considered almost equivalent if the differences between the frequencies of each letter from 'a' to 'z' between word1 and word2 …
原文链接: https://leetcode-cn.com/problems/check-if-an-original-string-exists-given-two-encoded-strings 英文原文An original string, consisting of lowercase English letters, can be encoded by the following steps: Arbitrarily split it into a sequence of some n…
原文链接: https://leetcode-cn.com/problems/count-vowel-substrings-of-a-string 英文原文A substring is a contiguous (non-empty) sequence of characters within a string. A vowel substring is a substring that only consists of vowels ('a', 'e', 'i', 'o', and 'u') …
原文链接: https://leetcode-cn.com/problems/vowels-of-all-substrings 英文原文Given a string word, return the sum of the number of vowels ('a', 'e', 'i', 'o', and 'u') in every substring of word. A substring is a contiguous (non-empty) sequence of characters w…
原文链接: https://leetcode-cn.com/problems/count-common-words-with-one-occurrence 英文原文Given two string arrays words1 and words2, return the number of strings that appear exactly once in each of the two arrays. Example 1: Input: words1 = ["leetcode","is",…
原文链接: https://leetcode-cn.com/problems/decode-the-slanted-ciphertext 英文原文A string originalText is encoded using a slanted transposition cipher to a string encodedText with the help of a matrix having a fixed number of rows rows. originalText is place…
原文链接: https://leetcode-cn.com/problems/is-unique-lcci 英文原文Implement an algorithm to determine if a string has all unique characters. What if you cannot use additional data structures? Example 1: Input: s = "leetcode" Output: false Example 2: Input: s…
原文链接: https://leetcode-cn.com/problems/check-permutation-lcci 英文原文Given two strings,write a method to decide if one is a permutation of the other. Example 1: Input: s1 = "abc", s2 = "bca" Output: true Example 2: Input: s1 = "abc", s2 = "bad" Output: …
原文链接: https://leetcode-cn.com/problems/string-to-url-lcci 英文原文Write a method to replace all spaces in a string with '%20'. You may assume that the string has sufficient space at the end to hold the additional characters,and that you are given the "tr…
原文链接: https://leetcode-cn.com/problems/compress-string-lcci 英文原文Implement a method to perform basic string compression using the counts of repeated characters. For example, the string aabcccccaaa would become a2blc5a3. If the "compressed" string woul…
原文链接: https://leetcode-cn.com/problems/string-rotation-lcci 英文原文Given two strings, s1 and s2, write code to check if s2 is a rotation of s1 (e.g.,"waterbottle" is a rotation of"erbottlewat"). Can you use only one call to the method that checks if one…
原文链接: https://leetcode-cn.com/problems/palindrome-permutation-lcci 英文原文Given a string, write a function to check if it is a permutation of a palindrome. A palindrome is a word or phrase that is the same forwards and backwards. A permutation is a rear…
原文链接: https://leetcode-cn.com/problems/bracket-lcci 英文原文Implement an algorithm to print all valid (e.g., properly opened and closed) combinations of n pairs of parentheses. Note: The result set should not contain duplicated subsets. For example, give…
原文链接: https://leetcode-cn.com/problems/bianry-number-to-string-lcci 英文原文Given a real number between 0 and 1 (e.g., 0.72) that is passed in as a double, print the binary representation. If the number cannot be represented accurately in binary with at …