leetcode
leetcode copied to clipboard
Provide all my solutions and explanations in Chinese for all the Leetcode coding problems.
In a 2D grid of `0`s and `1`s, we change at most one `0` to a `1`. After, what is the size of the largest island? (An island is a...
There are `n` servers numbered from `0` to `n - 1` connected by undirected server-to-server `connections` forming a network where `connections[i] = [ai, bi]` represents a connection between servers `ai` ...
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...
An N x N `board` contains only `0`s and `1`s. In each move, you can swap any 2 rows with each other, or any 2 columns with each other. What...
[请点击下方图片观看讲解视频](https://www.youtube.com/watch?v=lA1juZOD8Hk) [Click below image to watch YouTube Video](https://www.youtube.com/watch?v=lA1juZOD8Hk) [](https://www.youtube.com/watch?v=lA1juZOD8Hk) Given an integer array `nums` sorted in non-decreasing order, remove some duplicates [in-place](https://en.wikipedia.org/wiki/In-place_algorithm) such that each unique element appears at most...
[请点击下方图片观看讲解视频](https://www.youtube.com/watch?v=oz5wi1BsrHY) [Click below image to watch YouTube Video](https://www.youtube.com/watch?v=oz5wi1BsrHY) [](https://www.youtube.com/watch?v=oz5wi1BsrHY) Given an `m x n` grid of characters `board` and a string `word`, return `true` _if_ `word` _exists in the grid_....
[请点击下方图片观看讲解视频](https://www.youtube.com/watch?v=wGtzfVB_DvM) [Click below image to watch YouTube Video](https://www.youtube.com/watch?v=wGtzfVB_DvM) [](https://www.youtube.com/watch?v=wGtzfVB_DvM) Given an integer array `nums` of unique elements, return _all possible_ _subsets_ _(the power set)_. The solution set must not contain...
[请点击下方图片观看讲解视频](https://www.youtube.com/watch?v=Rhwh6eVQBg4) [Click below image to watch YouTube Video](https://www.youtube.com/watch?v=Rhwh6eVQBg4) [](https://www.youtube.com/watch?v=Rhwh6eVQBg4) Given two integers `n` and `k`, return _all possible combinations of_ `k` _numbers chosen from the range_ `[1, n]`. You may...
[请点击下方图片观看讲解视频](https://www.youtube.com/watch?v=T9-kjwz6bu0) [Click below image to watch YouTube Video](https://www.youtube.com/watch?v=T9-kjwz6bu0) [](https://www.youtube.com/watch?v=T9-kjwz6bu0) Given two strings `s` and `t` of lengths `m` and `n` respectively, return _the minimum window_ _substring_ _of_`s` _such that every...
[请点击下方图片观看讲解视频](https://www.youtube.com/watch?v=usZsoHqBMnE) [Click below image to watch YouTube Video](https://www.youtube.com/watch?v=usZsoHqBMnE) [](https://www.youtube.com/watch?v=usZsoHqBMnE) Given an array `nums` with `n` objects colored red, white, or blue, sort them [in-place](https://en.wikipedia.org/wiki/In-place_algorithm) so that objects of the same...