原文链接: https://leetcode-cn.com/problems/classes-more-than-5-students 英文原文Table: Courses +-------------+---------+ | Column Name | Type | +-------------+---------+ | student | varchar | | class | varchar | +-------------+---------+ (student, class) is …
分类详情
简单 分类
原文链接: https://leetcode-cn.com/problems/range-addition-ii 英文原文You are given an m x n matrix M initialized with all 0's and an array of operations ops, where ops[i] = [ai, bi] means M[x][y] should be incremented by one for all 0 <= x < ai and 0 <= y < …
原文链接: https://leetcode-cn.com/problems/minimum-index-sum-of-two-lists 英文原文Suppose Andy and Doris want to choose a restaurant for dinner, and they both have a list of favorite restaurants represented by strings. You need to help them find out their co…
原文链接: https://leetcode-cn.com/problems/can-place-flowers 英文原文You have a long flowerbed in which some of the plots are planted, and some are not. However, flowers cannot be planted in adjacent plots. Given an integer array flowerbed containing 0's and…
原文链接: https://leetcode-cn.com/problems/construct-string-from-binary-tree 英文原文Given the root of a binary tree, construct a string consisting of parenthesis and integers from a binary tree with the preorder traversal way, and return it. Omit all the em…
原文链接: https://leetcode-cn.com/problems/merge-two-binary-trees 英文原文You are given two binary trees root1 and root2. Imagine that when you put one of them to cover the other, some nodes of the two trees are overlapped while the others are not. You need …
原文链接: https://leetcode-cn.com/problems/not-boring-movies 英文原文Table: Cinema +----------------+----------+ | Column Name | Type | +----------------+----------+ | id | int | | movie | varchar | | description | varchar | | rating | float | +-------------…
原文链接: https://leetcode-cn.com/problems/swap-salary 英文原文Table: Salary +-------------+----------+ | Column Name | Type | +-------------+----------+ | id | int | | name | varchar | | sex | ENUM | | salary | int | +-------------+----------+ id is the pri…
原文链接: https://leetcode-cn.com/problems/maximum-product-of-three-numbers 英文原文Given an integer array nums, find three numbers whose product is maximum and return the maximum product. Example 1: Input: nums = [1,2,3] Output: 6 Example 2: Input: nums = […
原文链接: https://leetcode-cn.com/problems/maximum-average-subarray-i 英文原文You are given an integer array nums consisting of n elements, and an integer k. Find a contiguous subarray whose length is equal to k that has the maximum average value and return …
原文链接: https://leetcode-cn.com/problems/set-mismatch 英文原文You have a set of integers s, which originally contains all the numbers from 1 to n. Unfortunately, due to some error, one of the numbers in s got duplicated to another number in the set, which …
原文链接: https://leetcode-cn.com/problems/two-sum-iv-input-is-a-bst 英文原文Given the root of a Binary Search Tree and a target number k, return true if there exist two elements in the BST such that their sum is equal to the given target. Example 1: Input: …
原文链接: https://leetcode-cn.com/problems/robot-return-to-origin 英文原文There is a robot starting at the position (0, 0), the origin, on a 2D plane. Given a sequence of its moves, judge if this robot ends up at (0, 0) after it completes its moves. You are …
原文链接: https://leetcode-cn.com/problems/image-smoother 英文原文An image smoother is a filter of the size 3 x 3 that can be applied to each cell of an image by rounding down the average of the cell and the eight surrounding cells (i.e., the average of the …
原文链接: https://leetcode-cn.com/problems/longest-continuous-increasing-subsequence 英文原文Given an unsorted array of integers nums, return the length of the longest continuous increasing subsequence (i.e. subarray). The subsequence must be strictly increa…
原文链接: https://leetcode-cn.com/problems/valid-palindrome-ii 英文原文Given a string s, return true if the s can be palindrome after deleting at most one character from it. Example 1: Input: s = "aba" Output: true Example 2: Input: s = "abca" Output: true E…
原文链接: https://leetcode-cn.com/problems/count-binary-substrings 英文原文Give a binary string s, return the number of non-empty substrings that have the same number of 0's and 1's, and all the 0's and all the 1's in these substrings are grouped consecutive…
原文链接: https://leetcode-cn.com/problems/degree-of-an-array 英文原文Given a non-empty array of non-negative integers nums, the degree of this array is defined as the maximum frequency of any one of its elements. Your task is to find the smallest possible l…
原文链接: https://leetcode-cn.com/problems/1-bit-and-2-bit-characters 英文原文We have two special characters: The first character can be represented by one bit 0. The second character can be represented by two bits (10 or 11). Given a binary array bits that …
原文链接: https://leetcode-cn.com/problems/longest-word-in-dictionary 英文原文Given an array of strings words representing an English Dictionary, return the longest word in words that can be built one character at a time by other words in words. If there is …
原文链接: https://leetcode-cn.com/problems/find-pivot-index 英文原文Given an array of integers nums, calculate the pivot index of this array. The pivot index is the index where the sum of all the numbers strictly to the left of the index is equal to the sum …
原文链接: https://leetcode-cn.com/problems/self-dividing-numbers 英文原文A self-dividing number is a number that is divisible by every digit it contains. For example, 128 is a self-dividing number because 128 % 1 == 0, 128 % 2 == 0, and 128 % 8 == 0. A self-…
原文链接: https://leetcode-cn.com/problems/flood-fill 英文原文An image is represented by an m x n integer grid image where image[i][j] represents the pixel value of the image. You are also given three integers sr, sc, and newColor. You should perform a flood…
原文链接: https://leetcode-cn.com/problems/find-smallest-letter-greater-than-target 英文原文Given a characters array letters that is sorted in non-decreasing order and a character target, return the smallest character in the array that is larger than target.…
原文链接: https://leetcode-cn.com/problems/largest-number-at-least-twice-of-others 英文原文You are given an integer array nums where the largest integer is unique. Determine whether the largest element in the array is at least twice as much as every other nu…
原文链接: https://leetcode-cn.com/problems/min-cost-climbing-stairs 英文原文You are given an integer array cost where cost[i] is the cost of ith step on a staircase. Once you pay the cost, you can either climb one or two steps. You can either start from the …
原文链接: https://leetcode-cn.com/problems/shortest-completing-word 英文原文Given a string licensePlate and an array of strings words, find the shortest completing word in words. A completing word is a word that contains all the letters in licensePlate. Igno…
原文链接: https://leetcode-cn.com/problems/prime-number-of-set-bits-in-binary-representation 英文原文Given two integers left and right, return the count of numbers in the inclusive range [left, right] having a prime number of set bits in their binary represe…
原文链接: https://leetcode-cn.com/problems/maximum-depth-of-n-ary-tree 英文原文Given a n-ary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node. Nary-Tree input seri…
原文链接: https://leetcode-cn.com/problems/n-ary-tree-postorder-traversal 英文原文Given the root of an n-ary tree, return the postorder traversal of its nodes' values. Nary-Tree input serialization is represented in their level order traversal. Each group of…