原文链接: https://leetcode-cn.com/problems/the-number-of-full-rounds-you-have-played 英文原文A new online video game has been released, and in this video game, there are 15-minute rounds scheduled every quarter-hour period. This means that at HH:00, HH:15, H…
分类详情
中等 分类
原文链接: https://leetcode-cn.com/problems/minimum-absolute-difference-queries 英文原文The minimum absolute difference of an array a is defined as the minimum value of |a[i] - a[j]|, where 0 <= i < j < a.length and a[i] != a[j]. If all elements of a are the …
原文链接: https://leetcode-cn.com/problems/nearest-exit-from-entrance-in-maze 英文原文You are given an m x n matrix maze (0-indexed) with empty cells (represented as '.') and walls (represented as '+'). You are also given the entrance of the maze, where entr…
原文链接: https://leetcode-cn.com/problems/sum-game 英文原文Alice and Bob take turns playing a game, with Alice starting first. You are given a string num of even length consisting of digits and '?' characters. On each turn, a player will do the following if…
原文链接: https://leetcode-cn.com/problems/cyclically-rotating-a-grid 英文原文You are given an m x n integer matrix grid, where m and n are both even integers, and an integer k. The matrix is composed of several layers, which is shown in the below image, …
原文链接: https://leetcode-cn.com/problems/number-of-wonderful-substrings 英文原文A wonderful string is a string where at most one letter appears an odd number of times. For example, "ccjjc" and "abab" are wonderful, but "ab" is not. Given a string word that…
原文链接: https://leetcode-cn.com/problems/find-a-peak-element-ii 英文原文A peak element in a 2D grid is an element that is strictly greater than all of its adjacent neighbors to the left, right, top, and bottom. Given a 0-indexed m x n matrix mat where no t…
原文链接: https://leetcode-cn.com/problems/eliminate-maximum-number-of-monsters 英文原文You are playing a video game where you are defending your city from a group of n monsters. You are given a 0-indexed integer array dist of size n, where dist[i] is the in…
原文链接: https://leetcode-cn.com/problems/count-good-numbers 英文原文A digit string is good if the digits (0-indexed) at even indices are even and the digits at odd indices are prime (2, 3, 5, or 7). For example, "2582" is good because the digits (2 and 8) …
原文链接: https://leetcode-cn.com/problems/the-number-of-the-smallest-unoccupied-chair 英文原文There is a party where n friends numbered from 0 to n - 1 are attending. There is an infinite number of chairs in this party that are numbered from 0 to infinity. …
原文链接: https://leetcode-cn.com/problems/describe-the-painting 英文原文There is a long and thin painting that can be represented by a number line. The painting was painted with multiple overlapping segments where each segment was painted with a unique colo…
原文链接: https://leetcode-cn.com/problems/unique-length-3-palindromic-subsequences 英文原文Given a string s, return the number of unique palindromes of length three that are a subsequence of s. Note that even if there are multiple ways to obtain the same su…
原文链接: https://leetcode-cn.com/problems/add-minimum-number-of-rungs 英文原文You are given a strictly increasing integer array rungs that represents the height of rungs on a ladder. You are currently on the floor at height 0, and you want to reach the last…
原文链接: https://leetcode-cn.com/problems/maximum-number-of-points-with-cost 英文原文You are given an m x n integer matrix points (0-indexed). Starting with 0 points, you want to maximize the number of points you can get from the matrix. To gain points, you…
原文链接: https://leetcode-cn.com/problems/largest-number-after-mutating-substring 英文原文You are given a string num, which represents a large integer. You are also given a 0-indexed integer array change of length 10 that maps each digit 0-9 to another digi…
原文链接: https://leetcode-cn.com/problems/maximum-compatibility-score-sum 英文原文There is a survey that consists of n questions where each question's answer is either 0 (no) or 1 (yes). The survey was given to m students numbered from 0 to m - 1 and m ment…
原文链接: https://leetcode-cn.com/problems/check-if-move-is-legal 英文原文You are given a 0-indexed 8 x 8 grid board, where board[r][c] represents the cell (r, c) on a game board. On the board, free cells are represented by '.', white cells are represented b…
原文链接: https://leetcode-cn.com/problems/maximum-number-of-weeks-for-which-you-can-work 英文原文There are n projects numbered from 0 to n - 1. You are given an integer array milestones where each milestones[i] denotes the number of milestones the ith proje…
原文链接: https://leetcode-cn.com/problems/array-with-elements-not-equal-to-average-of-neighbors 英文原文You are given a 0-indexed array nums of distinct integers. You want to rearrange the elements in the array such that every element in the rearranged arra…
原文链接: https://leetcode-cn.com/problems/maximum-matrix-sum 英文原文You are given an n x n integer matrix. You can do the following operation any number of times: Choose any two adjacent elements of matrix and multiply each of them by -1. Two elements are …
原文链接: https://leetcode-cn.com/problems/number-of-ways-to-arrive-at-destination 英文原文You are in a city that consists of n intersections numbered from 0 to n - 1 with bi-directional roads between some intersections. The inputs are generated such that yo…
原文链接: https://leetcode-cn.com/problems/remove-stones-to-minimize-the-total 英文原文You are given a 0-indexed integer array piles, where piles[i] represents the number of stones in the ith pile, and an integer k. You should apply the following operation e…
原文链接: https://leetcode-cn.com/problems/minimum-number-of-swaps-to-make-the-string-balanced 英文原文You are given a 0-indexed string s of even length n. The string consists of exactly n / 2 opening brackets '[' and n / 2 closing brackets ']'. A string is …
原文链接: https://leetcode-cn.com/problems/minimum-non-zero-product-of-the-array-elements 英文原文You are given a positive integer p. Consider an array nums (1-indexed) that consists of the integers in the inclusive range [1, 2p - 1] in their binary represen…
原文链接: https://leetcode-cn.com/problems/operations-on-tree 英文原文You are given a tree with n nodes numbered from 0 to n - 1 in the form of a parent array parent where parent[i] is the parent of the ith node. The root of the tree is node 0, so parent[0] …
原文链接: https://leetcode-cn.com/problems/find-unique-binary-string 英文原文Given an array of strings nums containing n unique binary strings each of length n, return a binary string of length n that does not appear in nums. If there are multiple answers, y…
原文链接: https://leetcode-cn.com/problems/minimize-the-difference-between-target-and-chosen-elements 英文原文You are given an m x n integer matrix mat and an integer target. Choose one integer from each row in the matrix such that the absolute difference be…
原文链接: https://leetcode-cn.com/problems/find-the-kth-largest-integer-in-the-array 英文原文You are given an array of strings nums and an integer k. Each string in nums represents an integer without leading zeros. Return the string that represents the kth l…
原文链接: https://leetcode-cn.com/problems/find-original-array-from-doubled-array 英文原文An integer array original is transformed into a doubled array changed by appending twice the value of every element in original, and then randomly shuffling the resulti…
原文链接: https://leetcode-cn.com/problems/maximum-earnings-from-taxi 英文原文There are n points on a road you are driving your taxi on. The n points on the road are labeled from 1 to n in the direction you are going, and you want to drive from point 1 to po…