原文链接: https://leetcode-cn.com/problems/non-overlapping-intervals 英文原文Given an array of intervals intervals where intervals[i] = [starti, endi], return the minimum number of intervals you need to remove to make the rest of the intervals non-overlappin…
标签详情
动态规划 分类
原文链接: https://leetcode-cn.com/problems/arithmetic-slices-ii-subsequence 英文原文Given an integer array nums, return the number of all the arithmetic subsequences of nums. A sequence of numbers is called arithmetic if it consists of at least three element…
原文链接: https://leetcode-cn.com/problems/poor-pigs 英文原文There are buckets buckets of liquid, where exactly one of the buckets is poisonous. To figure out which one is poisonous, you feed some number of (poor) pigs the liquid to see whether they will die…
原文链接: https://leetcode-cn.com/problems/can-i-win 英文原文In the "100 game" two players take turns adding, to a running total, any integer from 1 to 10. The player who first causes the running total to reach or exceed 100 wins. What if we change the game …
原文链接: https://leetcode-cn.com/problems/count-the-repetitions 英文原文We define str = [s, n] as the string str which consists of the string s concatenated n times. For example, str == ["abc", 3] =="abcabcabc". We define that string s1 can be obtained from…
原文链接: https://leetcode-cn.com/problems/unique-substrings-in-wraparound-string 英文原文We define the string s to be the infinite wraparound string of "abcdefghijklmnopqrstuvwxyz", so s will look like this: "...zabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqr…
原文链接: https://leetcode-cn.com/problems/concatenated-words 英文原文Given an array of strings words (without duplicates), return all the concatenated words in the given list of words. A concatenated word is defined as a string that is comprised entirely of…
原文链接: https://leetcode-cn.com/problems/ones-and-zeroes 英文原文You are given an array of binary strings strs and two integers m and n. Return the size of the largest subset of strs such that there are at most m 0's and n 1's in the subset. A set x is a s…
原文链接: https://leetcode-cn.com/problems/matchsticks-to-square 英文原文You are given an integer array matchsticks where matchsticks[i] is the length of the ith matchstick. You want to use all the matchsticks to make one square. You should not break any sti…
原文链接: https://leetcode-cn.com/problems/predict-the-winner 英文原文You are given an integer array nums. Two players are playing a game with this array: player 1 and player 2. Player 1 and player 2 take turns, with player 1 starting first. Both players sta…
原文链接: https://leetcode-cn.com/problems/zuma-game 英文原文You are playing a variation of the game Zuma. In this variation of Zuma, there is a single row of colored balls on a board, where each ball can be colored red 'R', yellow 'Y', blue 'B', green 'G', …
原文链接: https://leetcode-cn.com/problems/kth-smallest-instructions 英文原文Bob is standing at cell (0, 0), and he wants to reach destination: (row, column). He can only travel right and down. You are going to help Bob by providing instructions for him to r…
原文链接: https://leetcode-cn.com/problems/target-sum 英文原文You are given an integer array nums and an integer target. You want to build an expression out of nums by adding one of the symbols '+' and '-' before each integer in nums and then concatenate all…
原文链接: https://leetcode-cn.com/problems/freedom-trail 英文原文In the video game Fallout 4, the quest "Road to Freedom" requires players to reach a metal dial called the "Freedom Trail Ring" and use the dial to spell a specific keyword to open the door. Gi…
原文链接: https://leetcode-cn.com/problems/longest-palindromic-subsequence 英文原文Given a string s, find the longest palindromic subsequence's length in s. A subsequence is a sequence that can be derived from another sequence by deleting some or no elements…
原文链接: https://leetcode-cn.com/problems/coin-change-2 英文原文You are given an integer array coins representing coins of different denominations and an integer amount representing a total amount of money. Return the number of combinations that make up tha…
原文链接: https://leetcode-cn.com/problems/beautiful-arrangement 英文原文Suppose you have n integers labeled 1 through n. A permutation of those n integers perm (1-indexed) is considered a beautiful arrangement if for every i (1 <= i <= n), either of the fol…
原文链接: https://leetcode-cn.com/problems/01-matrix 英文原文Given an m x n binary matrix mat, return the distance of the nearest 0 for each cell. The distance between two adjacent cells is 1. Example 1: Input: mat = [[0,0,0],[0,1,0],[0,0,0]] Output: [[0,0,0…
原文链接: https://leetcode-cn.com/problems/remove-boxes 英文原文You are given several boxes with different colors represented by different positive numbers. You may experience several rounds to remove boxes until there is no box left. Each time you can choos…
原文链接: https://leetcode-cn.com/problems/student-attendance-record-ii 英文原文An attendance record for a student can be represented as a string where each character signifies whether the student was absent, late, or present on that day. The record only con…
原文链接: https://leetcode-cn.com/problems/optimal-division 英文原文You are given an integer array nums. The adjacent integers in nums will perform the float division. For example, for nums = [2,3,4], we will evaluate the expression "2/3/4". However, you can…
原文链接: https://leetcode-cn.com/problems/out-of-boundary-paths 英文原文There is an m x n grid with a ball. The ball is initially at the position [startRow, startColumn]. You are allowed to move the ball to one of the four adjacent cells in the grid (possib…
原文链接: https://leetcode-cn.com/problems/delete-operation-for-two-strings 英文原文Given two strings word1 and word2, return the minimum number of steps required to make word1 and word2 the same. In one step, you can delete exactly one character in either s…
原文链接: https://leetcode-cn.com/problems/non-negative-integers-without-consecutive-ones 英文原文Given a positive integer n, return the number of the integers in the range [0, n] whose binary representations do not contain consecutive ones. Example 1: Input…
原文链接: https://leetcode-cn.com/problems/k-inverse-pairs-array 英文原文For an integer array nums, an inverse pair is a pair of integers [i, j] where 0 <= i < j < nums.length and nums[i] > nums[j]. Given two integers n and k, return the number of different …
原文链接: https://leetcode-cn.com/problems/shopping-offers 英文原文In LeetCode Store, there are n items to sell. Each item has a price. However, there are some special offers, and a special offer consists of one or more different kinds of items with a sale p…
原文链接: https://leetcode-cn.com/problems/decode-ways-ii 英文原文A message containing letters from A-Z can be encoded into numbers using the following mapping: 'A' -> "1" 'B' -> "2" ... 'Z' -> "26" To decode an encoded message, all the digits must be groupe…
原文链接: https://leetcode-cn.com/problems/maximum-length-of-pair-chain 英文原文You are given an array of n pairs pairs where pairs[i] = [lefti, righti] and lefti < righti. A pair p2 = [c, d] follows a pair p1 = [a, b] if b < c. A chain of pairs can be forme…
原文链接: https://leetcode-cn.com/problems/palindromic-substrings 英文原文Given a string s, return the number of palindromic substrings in it. A string is a palindrome when it reads the same backward as forward. A substring is a contiguous sequence of charac…
原文链接: https://leetcode-cn.com/problems/2-keys-keyboard 英文原文There is only one character 'A' on the screen of a notepad. You can perform two operations on this notepad for each step: Copy All: You can copy all the characters present on the screen (a pa…