原文链接: https://leetcode-cn.com/problems/maximum-number-of-visible-points 英文原文You are given an array points, an integer angle, and your location, where location = [posx, posy] and points[i] = [xi, yi] both denote integral coordinates on the X-Y plane. …
分类详情
困难 分类
原文链接: https://leetcode-cn.com/problems/count-subtrees-with-max-distance-between-cities 英文原文There are n cities numbered from 1 to n. You are given an array edges of size n-1, where edges[i] = [ui, vi] represents a bidirectional edge between cities ui …
原文链接: 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/distribute-repeating-integers 英文原文You are given an array of n integers, nums, where there are at most 50 unique values in the array. You are also given an array of m customer order quantities, quantity, where qu…
原文链接: https://leetcode-cn.com/problems/minimum-number-of-removals-to-make-mountain-array 英文原文You may recall that an array arr is a mountain array if and only if: arr.length >= 3 There exists some index i (0-indexed) with 0 < i < arr.length - 1 such t…
原文链接: https://leetcode-cn.com/problems/maximize-grid-happiness 英文原文You are given four integers, m, n, introvertsCount, and extrovertsCount. You have an m x n grid, and there are two types of people: introverts and extroverts. There are introvertsCoun…
原文链接: https://leetcode-cn.com/problems/minimum-interval-to-include-each-query 英文原文You are given a 2D integer array intervals, where intervals[i] = [lefti, righti] describes the ith interval starting at lefti and ending at righti (inclusive). The size…
原文链接: https://leetcode-cn.com/problems/largest-color-value-in-a-directed-graph 英文原文There is a directed graph of n colored nodes and m edges. The nodes are numbered from 0 to n - 1. You are given a string colors where colors[i] is a lowercase English …
原文链接: https://leetcode-cn.com/problems/minimum-xor-sum-of-two-arrays 英文原文You are given two integer arrays nums1 and nums2 of length n. The XOR sum of the two integer arrays is (nums1[0] XOR nums2[0]) + (nums1[1] XOR nums2[1]) + ... + (nums1[n - 1] XO…
原文链接: https://leetcode-cn.com/problems/number-of-ways-to-rearrange-sticks-with-k-sticks-visible 英文原文There are n uniquely-sized sticks whose lengths are integers from 1 to n. You want to arrange the sticks such that exactly k sticks are visible from t…
原文链接: https://leetcode-cn.com/problems/stone-game-viii 英文原文Alice and Bob take turns playing a game, with Alice starting first. There are n stones arranged in a row. On each player's turn, while the number of stones is more than one, they will do the …
原文链接: https://leetcode-cn.com/problems/minimum-cost-to-change-the-final-value-of-expression 英文原文You are given a valid boolean expression as a string expression consisting of the characters '1','0','&' (bitwise AND operator),'|' (bitwise OR operator),…
原文链接: https://leetcode-cn.com/problems/minimum-space-wasted-from-packaging 英文原文You have n packages that you are trying to place in boxes, one package in each box. There are m suppliers that each produce boxes of different sizes (with infinite supply)…
原文链接: https://leetcode-cn.com/problems/design-movie-rental-system 英文原文You have a movie renting company consisting of n shops. You want to implement a renting system that supports searching for, booking, and returning movies. The system should also su…
原文链接: https://leetcode-cn.com/problems/the-earliest-and-latest-rounds-where-players-compete 英文原文There is a tournament where n players are participating. The players are standing in a single row and are numbered from 1 to n based on their initial stan…
原文链接: https://leetcode-cn.com/problems/minimum-cost-to-reach-destination-in-time 英文原文There is a country of n cities numbered from 0 to n - 1 where all the cities are connected by bi-directional roads. The roads are represented as a 2D integer array e…
原文链接: https://leetcode-cn.com/problems/longest-common-subpath 英文原文There is a country of n cities numbered from 0 to n - 1. In this country, there is a road connecting every pair of cities. There are m friends numbered from 0 to m - 1 who are travelin…
原文链接: https://leetcode-cn.com/problems/merge-bsts-to-create-single-bst 英文原文You are given n BST (binary search tree) root nodes for n separate BSTs stored in an array trees (0-indexed). Each BST in trees has at most 3 nodes, and no two roots have the …
原文链接: https://leetcode-cn.com/problems/painting-a-grid-with-three-different-colors 英文原文You are given two integers m and n. Consider an m x n grid where each cell is initially white. You can paint each cell red, green, or blue. All cells must be paint…
原文链接: https://leetcode-cn.com/problems/maximum-genetic-difference-query 英文原文There is a rooted tree consisting of n nodes numbered 0 to n - 1. Each node's number denotes its unique genetic value (i.e. the genetic value of node x is x). The genetic dif…
原文链接: https://leetcode-cn.com/problems/delete-duplicate-folders-in-system 英文原文Due to a bug, there are many duplicate folders in a file system. You are given a 2D array paths, where paths[i] is an array representing an absolute path to the ith folder …
原文链接: https://leetcode-cn.com/problems/count-number-of-special-subsequences 英文原文A sequence is special if it consists of a positive number of 0s, followed by a positive number of 1s, then a positive number of 2s. For example, [0,1,2] and [0,0,1,1,1,2]…
原文链接: https://leetcode-cn.com/problems/number-of-ways-to-separate-numbers 英文原文You wrote down many positive integers in a string called num. However, you realized that you forgot to add commas to seperate the different numbers. You remember that the l…
原文链接: https://leetcode-cn.com/problems/find-the-longest-valid-obstacle-course-at-each-position 英文原文You want to build some obstacle courses. You are given a 0-indexed integer array obstacles of length n, where obstacles[i] describes the height of the …
原文链接: https://leetcode-cn.com/problems/last-day-where-you-can-still-cross 英文原文There is a 1-based binary matrix where 0 represents land and 1 represents water. You are given integers row and col representing the number of rows and columns in the matri…
原文链接: https://leetcode-cn.com/problems/the-number-of-good-subsets 英文原文You are given an integer array nums. We call a subset of nums good if its product can be represented as a product of one or more distinct prime numbers. For example, if nums = [1, …
原文链接: https://leetcode-cn.com/problems/find-array-given-subset-sums 英文原文You are given an integer n representing the length of an unknown array that you are trying to recover. You are also given an array sums containing the values of all 2n subset sum…
原文链接: 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/minimum-number-of-operations-to-make-array-continuous 英文原文You are given an integer array nums. In one operation, you can replace any element in nums with any integer. nums is considered continuous if both of the…
原文链接: https://leetcode-cn.com/problems/smallest-missing-genetic-value-in-each-subtree 英文原文There is a family tree rooted at 0 consisting of n nodes numbered 0 to n - 1. You are given a 0-indexed integer array parents, where parents[i] is the parent fo…