原文链接: https://leetcode-cn.com/problems/sort-array-by-increasing-frequency 英文原文Given an array of integers nums, sort the array in increasing order based on the frequency of the values. If multiple values have the same frequency, sort them in decreasin…
分类详情
简单 分类
原文链接: 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/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/defuse-the-bomb 英文原文You have a bomb to defuse, and your time is running out! Your informer will provide you with a circular array code of length of n and a key k. To decrypt the code, you must replace every numb…
原文链接: https://leetcode-cn.com/problems/check-array-formation-through-concatenation 英文原文You are given an array of distinct integers arr and an array of integer arrays pieces, where the integers in pieces are distinct. Your goal is to form arr by conca…
原文链接: 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…
原文链接: https://leetcode-cn.com/problems/get-maximum-in-generated-array 英文原文You are given an integer n. A 0-indexed integer array nums of length n + 1 is generated in the following way: nums[0] = 0 nums[1] = 1 nums[2 * i] = nums[i] when 2 <= 2 * i <= n…
原文链接: https://leetcode-cn.com/problems/design-an-ordered-stream 英文原文There is a stream of n (idKey, value) pairs arriving in an arbitrary order, where idKey is an integer between 1 and n and value is a string. No two pairs have the same id. Design a s…
原文链接: https://leetcode-cn.com/problems/check-if-two-string-arrays-are-equivalent 英文原文Given two string arrays word1 and word2, return true if the two arrays represent the same string, and false otherwise. A string is represented by an array if the arr…
原文链接: https://leetcode-cn.com/problems/maximum-population-year 英文原文You are given a 2D integer array logs where each logs[i] = [birthi, deathi] indicates the birth and death years of the ith person. The population of some year x is the number of peopl…
原文链接: https://leetcode-cn.com/problems/substrings-of-size-three-with-distinct-characters 英文原文A string is good if there are no repeated characters. Given a string s, return the number of good substrings of length three in s. Note that if th…
原文链接: https://leetcode-cn.com/problems/sum-of-all-subset-xor-totals 英文原文The XOR total of an array is defined as the bitwise XOR of all its elements, or 0 if the array is empty. For example, the XOR total of the array [2,5,6] is 2 XOR 5 XOR 6 = 1. Giv…
原文链接: https://leetcode-cn.com/problems/longer-contiguous-segments-of-ones-than-zeros 英文原文Given a binary string s, return true if the longest contiguous segment of 1's is strictly longer than the longest contiguous segment of 0's in s, or return false…
原文链接: https://leetcode-cn.com/problems/check-if-all-the-integers-in-a-range-are-covered 英文原文You are given a 2D integer array ranges and two integers left and right. Each ranges[i] = [starti, endi] represents an inclusive interval between starti and e…
原文链接: https://leetcode-cn.com/problems/check-if-word-equals-summation-of-two-words 英文原文The letter value of a letter is its position in the alphabet starting from 0 (i.e. 'a' -> 0, 'b' -> 1, 'c' -> 2, etc.). The numerical value of some string of lower…
原文链接: https://leetcode-cn.com/problems/determine-whether-matrix-can-be-obtained-by-rotation 英文原文Given two n x n binary matrices mat and target, return true if it is possible to make mat equal to target by rotating mat in 90-degree increments, or fals…
原文链接: https://leetcode-cn.com/problems/remove-one-element-to-make-the-array-strictly-increasing 英文原文Given a 0-indexed integer array nums, return true if it can be made strictly increasing after removing exactly one element, or false otherwise. If the…
原文链接: https://leetcode-cn.com/problems/redistribute-characters-to-make-all-strings-equal 英文原文You are given an array of strings words (0-indexed). In one operation, pick two distinct indices i and j, where words[i] is a non-empty string, and move any …
原文链接: https://leetcode-cn.com/problems/largest-odd-number-in-string 英文原文You are given a string num, representing a large integer. Return the largest-valued odd integer (as a string) that is a non-empty substring of num, or an empty string "" if no od…
原文链接: https://leetcode-cn.com/problems/count-square-sum-triples 英文原文A square triple (a,b,c) is a triple where a, b, and c are integers and a2 + b2 = c2. Given an integer n, return the number of square triples such that 1 <= a, b, c <= n. Example 1: I…
原文链接: https://leetcode-cn.com/problems/maximum-product-difference-between-two-pairs 英文原文The product difference between two pairs (a, b) and (c, d) is defined as (a * b) - (c * d). For example, the product difference between (5, 6) and (2, 7) is (5 * …
原文链接: https://leetcode-cn.com/problems/build-array-from-permutation 英文原文Given a zero-based permutation nums (0-indexed), build an array ans of the same length where ans[i] = nums[nums[i]] for each 0 <= i < nums.length and return it. A zero-based perm…
原文链接: https://leetcode-cn.com/problems/check-if-all-characters-have-equal-number-of-occurrences 英文原文Given a string s, return true if s is a good string, or false otherwise. A string s is good if all the characters that appear in s have the same numbe…
原文链接: https://leetcode-cn.com/problems/sum-of-digits-of-string-after-convert 英文原文You are given a string s consisting of lowercase English letters, and an integer k. First, convert s into an integer by replacing each letter with its position in the al…
原文链接: https://leetcode-cn.com/problems/three-divisors 英文原文Given an integer n, return true if n has exactly three positive divisors. Otherwise, return false. An integer m is a divisor of n if there exists an integer k such that n = k * m. Example 1: I…
原文链接: https://leetcode-cn.com/problems/minimum-time-to-type-word-using-special-typewriter 英文原文There is a special typewriter with lowercase English letters 'a' to 'z' arranged in a circle with a pointer. A character can only be typed if the pointer is…
原文链接: https://leetcode-cn.com/problems/check-if-string-is-a-prefix-of-array 英文原文Given a string s and an array of strings words, determine whether s is a prefix string of words. A string s is a prefix string of words if s can be made by concatenating …
原文链接: https://leetcode-cn.com/problems/number-of-strings-that-appear-as-substrings-in-word 英文原文Given an array of strings patterns and a string word, return the number of strings in patterns that exist as a substring in word. A substring is a contiguo…
原文链接: https://leetcode-cn.com/problems/find-the-middle-index-in-array 英文原文Given a 0-indexed integer array nums, find the leftmost middleIndex (i.e., the smallest amongst all the possible ones). A middleIndex is an index where nums[0] + nums[1] + ... …
原文链接: https://leetcode-cn.com/problems/find-greatest-common-divisor-of-array 英文原文Given an integer array nums, return the greatest common divisor of the smallest number and largest number in nums. The greatest common divisor of two numbers is the larg…