原文链接: https://leetcode-cn.com/problems/array-of-doubled-pairs 英文原文Given an integer array of even length arr, return true if it is possible to reorder arr such that arr[2 * i + 1] = 2 * arr[2 * i] for every 0 <= i < len(arr) / 2, or false otherwise. E…
标签详情
数组 分类
原文链接: 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/tallest-billboard 英文原文You are installing a billboard and want it to have the largest height. The billboard will have two steel supports, one on each side. Each steel support must be an equal height. You are give…
原文链接: https://leetcode-cn.com/problems/prison-cells-after-n-days 英文原文There are 8 prison cells in a row and each cell is either occupied or vacant. Each day, whether the cell is occupied or vacant changes according to the following rules: If a cell ha…
原文链接: 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/n-repeated-element-in-size-2n-array 英文原文You are given an integer array nums with the following properties: nums.length == 2 * n. nums contains n + 1 unique elements. Exactly one element of nums is repeated n tim…
原文链接: https://leetcode-cn.com/problems/minimum-area-rectangle-ii 英文原文You are given an array of points in the X-Y plane points where points[i] = [xi, yi]. Return the minimum area of any rectangle formed from these points, with sides not necessarily pa…
原文链接: 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/pancake-sorting 英文原文Given an array of integers arr, sort the array by performing a series of pancake flips. In one pancake flip we do the following steps: Choose an integer k where 1 <= k <= arr.length. Reverse …
原文链接: https://leetcode-cn.com/problems/k-closest-points-to-origin 英文原文Given an array of points where points[i] = [xi, yi] represents a point on the X-Y plane and an integer k, return the k closest points to the origin (0, 0). The distance between two…
原文链接: https://leetcode-cn.com/problems/subarray-sums-divisible-by-k 英文原文Given an integer array nums and an integer k, return the number of non-empty subarrays that have a sum divisible by k. A subarray is a contiguous part of an array. Example 1: Inp…
原文链接: https://leetcode-cn.com/problems/odd-even-jump 英文原文You are given an integer array arr. From some starting index, you can make a series of jumps. The (1st, 3rd, 5th, ...) jumps in the series are called odd-numbered jumps, and the (2nd, 4th, 6th,…
原文链接: https://leetcode-cn.com/problems/largest-perimeter-triangle 英文原文Given an integer array nums, return the largest perimeter of a triangle with a non-zero area, formed from three of these lengths. If it is impossible to form any triangle of a non-…
原文链接: https://leetcode-cn.com/problems/squares-of-a-sorted-array 英文原文Given an integer array nums sorted in non-decreasing order, return an array of the squares of each number sorted in non-decreasing order. Example 1: Input: nums = [-4,-1,0,3,10] Out…
原文链接: https://leetcode-cn.com/problems/longest-turbulent-subarray 英文原文Given an integer array arr, return the length of a maximum size turbulent subarray of arr. A subarray is turbulent if the comparison sign flips between each adjacent pair of elemen…
原文链接: https://leetcode-cn.com/problems/unique-paths-iii 英文原文You are given an m x n integer array grid where grid[i][j] could be: 1 representing the starting square. There is exactly one starting square. 2 representing the ending square. There is exac…
原文链接: https://leetcode-cn.com/problems/triples-with-bitwise-and-equal-to-zero 英文原文Given an integer array nums, return the number of AND triples. An AND triple is a triple of indices (i, j, k) such that: 0 <= i < nums.length 0 <= j < nums.length 0 <= …
原文链接: https://leetcode-cn.com/problems/sum-of-even-numbers-after-queries 英文原文You are given an integer array nums and an array queries where queries[i] = [vali, indexi]. For each query i, first, apply nums[indexi] = nums[indexi] + vali, then print the…
原文链接: https://leetcode-cn.com/problems/interval-list-intersections 英文原文You are given two lists of closed intervals, firstList and secondList, where firstList[i] = [starti, endi] and secondList[j] = [startj, endj]. Each list of intervals is pairwise d…
原文链接: https://leetcode-cn.com/problems/add-to-array-form-of-integer 英文原文The array-form of an integer num is an array representing its digits in left to right order. For example, for num = 1321, the array form is [1,3,2,1]. Given num, the array-form o…
原文链接: 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/subarrays-with-k-different-integers 英文原文Given an integer array nums and an integer k, return the number of good subarrays of nums. A good array is an array where the number of different integers in that array is…
原文链接: https://leetcode-cn.com/problems/minimum-number-of-k-consecutive-bit-flips 英文原文You are given a binary array nums and an integer k. A k-bit flip is choosing a subarray of length k from nums and simultaneously changing every 0 in the subarray to …
原文链接: https://leetcode-cn.com/problems/number-of-squareful-arrays 英文原文An array is squareful if the sum of every pair of adjacent elements is a perfect square. Given an integer array nums, return the number of permutations of nums that are squareful. …
原文链接: https://leetcode-cn.com/problems/find-the-town-judge 英文原文In a town, there are n people labeled from 1 to n. There is a rumor that one of these people is secretly the town judge. If the town judge exists, then: The town judge trusts nobody. Ever…
原文链接: https://leetcode-cn.com/problems/available-captures-for-rook 英文原文On an 8 x 8 chessboard, there is exactly one white rook 'R' and some number of white bishops 'B', black pawns 'p', and empty squares '.'. When the rook moves, it chooses one of fo…
原文链接: https://leetcode-cn.com/problems/minimum-cost-to-merge-stones 英文原文There are n piles of stones arranged in a row. The ith pile has stones[i] stones. A move consists of merging exactly k consecutive piles into one pile, and the cost of this move …
原文链接: https://leetcode-cn.com/problems/grid-illumination 英文原文There is a 2D grid of size n x n where each cell of this grid has a lamp that is initially turned off. You are given a 2D array of lamp positions lamps, where lamps[i] = [rowi, coli] indica…
原文链接: 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/max-consecutive-ones-iii 英文原文Given a binary array nums and an integer k, return the maximum number of consecutive 1's in the array if you can flip at most k 0's. Example 1: Input: nums = [1,1,1,0,0,0,1,1,1,1,0],…