leetcode
leetcode copied to clipboard
Provide all my solutions and explanations in Chinese for all the Leetcode coding problems.
[请点击下方图片观看讲解视频](https://www.youtube.com/watch?v=Dnl3kz94tMs) [Click below image to watch YouTube Video](https://www.youtube.com/watch?v=Dnl3kz94tMs) [](https://www.youtube.com/watch?v=Dnl3kz94tMs) Given a `m x n` `grid` filled with non-negative numbers, find a path from top left to bottom right, which minimizes...
[请点击下方图片观看讲解视频](https://www.youtube.com/watch?v=CaILMEIf_j8) [Click below image to watch YouTube Video](https://www.youtube.com/watch?v=CaILMEIf_j8) [](https://www.youtube.com/watch?v=CaILMEIf_j8) You are given an `m x n` integer array `grid`. There is a robot initially located at the top-left corner (i.e.,...
[请点击下方图片观看讲解视频](https://www.youtube.com/watch?v=nx1j7ZJjlFg) [Click below image to watch YouTube Video](https://www.youtube.com/watch?v=nx1j7ZJjlFg) [](https://www.youtube.com/watch?v=nx1j7ZJjlFg) There is a robot on an `m x n` grid. The robot is initially located at the top-left corner (i.e., `grid[0][0]`)....
[请点击下方图片观看讲解视频](https://www.youtube.com/watch?v=FpkZuPbkPMo) [Click below image to watch YouTube Video](https://www.youtube.com/watch?v=FpkZuPbkPMo) [](https://www.youtube.com/watch?v=FpkZuPbkPMo) Given the `head` of a linked list, rotate the list to the right by `k` places. **Example 1:**  Input: head...
[请点击下方图片观看讲解视频](https://www.youtube.com/watch?v=Qy8RYT0S_Jc) [Click below image to watch YouTube Video](https://www.youtube.com/watch?v=Qy8RYT0S_Jc) [](https://www.youtube.com/watch?v=Qy8RYT0S_Jc) The set `[1, 2, 3, ..., n]` contains a total of `n!` unique permutations. By listing and labeling all of the...
[请点击下方图片观看讲解视频](https://www.youtube.com/watch?v=-AhofTERj_k) [Click below image to watch YouTube Video](https://www.youtube.com/watch?v=-AhofTERj_k) [](https://www.youtube.com/watch?v=-AhofTERj_k) Given a positive integer `n`, generate an `n x n` `matrix` filled with elements from `1` to `n2` in spiral order....
[请点击下方图片观看讲解视频](https://www.youtube.com/watch?v=tBJ647nEw7U) [Click below image to watch YouTube Video](https://www.youtube.com/watch?v=tBJ647nEw7U) [](https://www.youtube.com/watch?v=tBJ647nEw7U) Given a string `s` consisting of words and spaces, return _the length of the last word in the string._ A word...
[请点击下方图片观看讲解视频](https://www.youtube.com/watch?v=vYxLrcd2bhE) [Click below image to watch YouTube Video](https://www.youtube.com/watch?v=vYxLrcd2bhE) [](https://www.youtube.com/watch?v=vYxLrcd2bhE) You are given an array of non-overlapping intervals `intervals` where `intervals[i] = [starti, endi]` represent the start and the end of...
[请点击下方图片观看讲解视频](https://www.youtube.com/watch?v=V461ochvdg8) [Click below image to watch YouTube Video](https://www.youtube.com/watch?v=V461ochvdg8) [](https://www.youtube.com/watch?v=V461ochvdg8) Given an array of `intervals` where `intervals[i] = [starti, endi]`, merge all overlapping intervals, and return _an array of the non-overlapping...
[请点击下方图片观看讲解视频](https://www.youtube.com/watch?v=Vb_k-WXbHvY) [Click below image to watch YouTube Video](https://www.youtube.com/watch?v=Vb_k-WXbHvY) [](https://www.youtube.com/watch?v=Vb_k-WXbHvY) Given an `m x n` `matrix`, return _all elements of the_ `matrix` _in spiral order_. **Example 1:**  Input: matrix =...