原文链接: https://leetcode-cn.com/problems/maximum-number-of-darts-inside-of-a-circular-dartboard 英文原文You have a very large square wall and a circular dartboard placed on the wall. You have been challenged to throw darts into the board blindfolded. Darts…
分类详情
困难 分类
原文链接: https://leetcode-cn.com/problems/max-dot-product-of-two-subsequences 英文原文Given two arrays nums1 and nums2. Return the maximum dot product between non-empty subsequences of nums1 and nums2 with the same length. A subsequence of a array is a new …
原文链接: https://leetcode-cn.com/problems/allocate-mailboxes 英文原文Given the array houses and an integer k. where houses[i] is the location of the ith house along a street, your task is to allocate k mailboxes in the street. Return the minimum total dista…
原文链接: https://leetcode-cn.com/problems/probability-of-a-two-boxes-having-the-same-number-of-distinct-balls 英文原文Given 2n balls of k distinct colors. You will be given an integer array balls of size k where balls[i] is the number of balls of color i. A…
原文链接: https://leetcode-cn.com/problems/paint-house-iii 英文原文There is a row of m houses in a small city, each house must be painted with one of the n colors (labeled from 1 to n), some houses that have been painted last summer should not be painted aga…
原文链接: https://leetcode-cn.com/problems/parallel-courses-ii 英文原文You are given an integer n, which indicates that there are n courses labeled from 1 to n. You are also given an array relations where relations[i] = [prevCoursei, nextCoursei], representi…
原文链接: https://leetcode-cn.com/problems/find-critical-and-pseudo-critical-edges-in-minimum-spanning-tree 英文原文Given a weighted undirected connected graph with n vertices numbered from 0 to n - 1, and an array edges where edges[i] = [ai, bi, weighti] re…
原文链接: https://leetcode-cn.com/problems/stone-game-iv 英文原文Alice and Bob take turns playing a game, with Alice starting first. Initially, there are n stones in a pile. On each player's turn, that player makes a move consisting of removing any non-zero …
原文链接: https://leetcode-cn.com/problems/max-value-of-equation 英文原文You are given an array points containing the coordinates of points on a 2D plane, sorted by the x-values, where points[i] = [xi, yi] such that xi < xj for all 1 <= i < j <= points.lengt…
原文链接: 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/minimum-number-of-increments-on-subarrays-to-form-a-target-array 英文原文Given an array of positive integers target and an array initial of same size with all zeros. Return the minimum number of operations to form a…
原文链接: 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/best-position-for-a-service-centre 英文原文A delivery company wants to build a new service centre in a new city. The company knows the positions of all the customers in this city on a 2D-Map and wants to build the n…
原文链接: 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/get-the-maximum-score 英文原文You are given two sorted arrays of distinct integers nums1 and nums2. A valid path is defined as follows: Choose array nums1 or nums2 to traverse (from index-0). Traverse the current ar…
原文链接: 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/minimum-cost-to-cut-a-stick 英文原文Given a wooden stick of length n units. The stick is labelled from 0 to n. For example, a stick of length 6 is labelled as follows: Given an integer array cuts where cuts[i] denot…
原文链接: https://leetcode-cn.com/problems/minimum-number-of-days-to-eat-n-oranges 英文原文There are n oranges in the kitchen and you decided to eat some of these oranges every day as follows: Eat one orange. If the number of remaining oranges n is divisible…
原文链接: https://leetcode-cn.com/problems/count-all-possible-routes 英文原文You are given an array of distinct positive integers locations where locations[i] represents the position of city i. You are also given integers start, finish and fuel representing …
原文链接: https://leetcode-cn.com/problems/stone-game-v 英文原文There are several stones arranged in a row, and each stone has an associated value which is an integer given in the array stoneValue. In each round of the game, Alice divides the row into two no…
原文链接: https://leetcode-cn.com/problems/minimum-number-of-days-to-disconnect-island 英文原文Given a 2D grid consisting of 1s (land) and 0s (water). An island is a maximal 4-directionally (horizontal or vertical) connected group of 1s. The grid is said to …
原文链接: https://leetcode-cn.com/problems/number-of-ways-to-reorder-array-to-get-same-bst 英文原文Given an array nums that represents a permutation of integers from 1 to n. We are going to construct a binary search tree (BST) by inserting the elements of nu…
原文链接: https://leetcode-cn.com/problems/strange-printer-ii 英文原文There is a strange printer with the following two special requirements: On each turn, the printer will print a solid rectangular pattern of a single color on the grid. This will cover up t…
原文链接: https://leetcode-cn.com/problems/remove-max-number-of-edges-to-keep-graph-fully-traversable 英文原文Alice and Bob have an undirected graph of n nodes and 3 types of edges: Type 1: Can be traversed by Alice only. Type 2: Can be traversed by Bob only…
原文链接: 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/find-servers-that-handled-most-number-of-requests 英文原文You have k servers numbered from 0 to k-1 that are being used to handle multiple requests simultaneously. Each server has infinite computational capacity but…
原文链接: https://leetcode-cn.com/problems/minimum-cost-to-connect-two-groups-of-points 英文原文You are given two groups of points where the first group has size1 points, the second group has size2 points, and size1 >= size2. The cost of the connection betwe…
原文链接: https://leetcode-cn.com/problems/maximum-number-of-achievable-transfer-requests 英文原文We have n buildings numbered from 0 to n - 1. Each building has a number of employees. It's transfer season, and some employees want to change the building they…
原文链接: https://leetcode-cn.com/problems/fancy-sequence 英文原文Write an API that generates fancy sequences using the append, addAll, and multAll operations. Implement the Fancy class: Fancy() Initializes the object with an empty sequence. void append(val)…
原文链接: https://leetcode-cn.com/problems/minimum-one-bit-operations-to-make-integers-zero 英文原文Given an integer n, you must transform it into 0 using the following operations any number of times: Change the rightmost (0th) bit in the binary representati…