随笔分类 -  LeetCode

上一页 1 2 3 4 5 6 7 8 ··· 61 下一页
摘要:Given an array arr, replace every element in that array with the greatest element among the elements to its right, and replace the last element with - 阅读全文
posted @ 2022-05-18 12:50 Grandyang 阅读(204) 评论(0) 推荐(0)
摘要:You have n boxes labeled from 0 to n - 1. You are given four arrays: status, candies, keys, and containedBoxes where: status[i] is 1 if the ith box is 阅读全文
posted @ 2022-05-16 03:17 Grandyang 阅读(199) 评论(0) 推荐(0)
摘要:Given an integer array arr and a target value target, return the integer value such that when we change all the integers larger than value in the give 阅读全文
posted @ 2022-05-11 13:51 Grandyang 阅读(436) 评论(0) 推荐(0)
摘要:Given a string s, return the maximum number of ocurrences of any substring under the following rules: The number of unique characters in the substring 阅读全文
posted @ 2022-05-05 13:16 Grandyang 阅读(571) 评论(0) 推荐(0)
摘要:Given an array of integers nums and a positive integer k, check whether it is possible to divide this array into sets of k consecutive numbers. Return 阅读全文
posted @ 2022-04-27 11:41 Grandyang 阅读(290) 评论(0) 推荐(0)
摘要:Given an array nums of integers, return how many of them contain an even number of digits. Example 1: Input: nums = [12,345,2,6,7896] Output: 2 Explan 阅读全文
posted @ 2022-04-24 01:22 Grandyang 阅读(312) 评论(0) 推荐(0)
摘要:You are given an m x n integer matrix grid where each cell is either 0 (empty) or 1 (obstacle). You can move up, down, left, or right from and to an e 阅读全文
posted @ 2022-04-19 12:40 Grandyang 阅读(1062) 评论(0) 推荐(0)
摘要:Given a m x n matrix mat and an integer threshold, return the maximum side-length of a square with a sum less than or equal to threshold or return 0 i 阅读全文
posted @ 2022-04-15 09:51 Grandyang 阅读(1308) 评论(0) 推荐(0)
摘要:An integer has sequential digits if and only if each digit in the number is one more than the previous digit. Return a sorted list of all the integers 阅读全文
posted @ 2022-04-04 23:15 Grandyang 阅读(503) 评论(0) 推荐(0)
摘要:Given head which is a reference node to a singly-linked list. The value of each node in the linked list is either 0 or 1. The linked list holds the bi 阅读全文
posted @ 2022-03-25 22:55 Grandyang 阅读(513) 评论(0) 推荐(0)
摘要:Given an n x n integer matrix grid, return the minimum sum of a falling path with non-zero shifts. A falling path with non-zero shifts is a choice of 阅读全文
posted @ 2022-03-25 11:01 Grandyang 阅读(700) 评论(0) 推荐(0)
摘要:Given an array intervals where intervals[i] = [li, ri] represent the interval [li, ri), remove all intervals that are covered by another interval in t 阅读全文
posted @ 2022-03-22 13:45 Grandyang 阅读(507) 评论(0) 推荐(0)
摘要:Given an integer array sorted in non-decreasing order, there is exactly one integer in the array that occurs more than 25% of the time, return that in 阅读全文
posted @ 2022-03-20 08:31 Grandyang 阅读(458) 评论(0) 推荐(0)
摘要:Design the CombinationIterator class: CombinationIterator(string characters, int combinationLength) Initializes the object with a string characters of 阅读全文
posted @ 2022-03-07 13:54 Grandyang 阅读(419) 评论(0) 推荐(0)
摘要:Given a m x n binary matrix mat. In one step, you can choose one cell and flip it and all the four neighbors of it if they exist (Flip is changing 1 t 阅读全文
posted @ 2022-02-28 23:52 Grandyang 阅读(546) 评论(0) 推荐(0)
摘要:Given an array of integers nums and an integer threshold, we will choose a positive integer divisor, divide all the array by it, and sum the division' 阅读全文
posted @ 2022-01-17 20:34 Grandyang 阅读(422) 评论(0) 推荐(0)
摘要:There are n people that are split into some unknown number of groups. Each person is labeled with a unique ID from 0 to n - 1. You are given an intege 阅读全文
posted @ 2022-01-14 19:58 Grandyang 阅读(420) 评论(0) 推荐(0)
摘要:Given an integer number n, return the difference between the product of its digits and the sum of its digits. Example 1: Input: n = 234 Output: 15 Exp 阅读全文
posted @ 2022-01-07 19:06 Grandyang 阅读(344) 评论(0) 推荐(0)
摘要:You are given a string s containing lowercase letters and an integer k. You need to : First, change some characters of s to other lowercase English le 阅读全文
posted @ 2022-01-03 11:18 Grandyang 阅读(549) 评论(0) 推荐(0)
摘要:Given a m * n matrix of ones and zeros, return how many square submatrices have all ones. Example 1: Input: matrix = [ [0,1,1,1], [1,1,1,1], [0,1,1,1] 阅读全文
posted @ 2021-12-26 14:03 Grandyang 阅读(874) 评论(0) 推荐(0)

上一页 1 2 3 4 5 6 7 8 ··· 61 下一页
Fork me on GitHub