随笔分类 - LeetCode
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要:Design the CombinationIterator class: CombinationIterator(string characters, int combinationLength) Initializes the object with a string characters of
阅读全文
摘要: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
阅读全文
摘要: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'
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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]
阅读全文
摘要:Given two integers tomatoSlices and cheeseSlices. The ingredients of different burgers are as follows: Jumbo Burger: 4 tomato slices and 1 cheese slic
阅读全文
摘要:Tic-tac-toe is played by two players A and B on a 3 x 3 grid. The rules of Tic-Tac-Toe are: Players take turns placing characters into empty squares '
阅读全文
摘要:You have a pointer at index 0 in an array of size arrLen. At each step, you can move 1 position to the left, 1 position to the right in the array, or
阅读全文