leetcode
leetcode copied to clipboard
Provide all my solutions and explanations in Chinese for all the Leetcode coding problems.
In a row of `seats`, `1` represents a person sitting in that seat, and `0` represents that the seat is empty. There is at least one empty seat, and at...
You are given an integer array `nums` of length `n` where `nums` is a permutation of the numbers in the range `[0, n - 1]`. You should build a set ...
[请点击下方图片观看讲解视频](https://www.youtube.com/watch?v=n28H5o3-wKM) [Click below image to watch YouTube Video](https://www.youtube.com/watch?v=n28H5o3-wKM) [](https://www.youtube.com/watch?v=n28H5o3-wKM) Given two strings `word1` and `word2`, return _the minimum number of operations required to convert`word1` to `word2`_. You have the following...
[请点击下方图片观看讲解视频](https://www.youtube.com/watch?v=VDGZEbKjY6c) [Click below image to watch YouTube Video](https://www.youtube.com/watch?v=VDGZEbKjY6c) [](https://www.youtube.com/watch?v=VDGZEbKjY6c) You are given an integer array `nums`. You are initially positioned at the array's first index, and each element in the...
`n` passengers board an airplane with exactly `n` seats. The first passenger has lost the ticket and picks a seat randomly. But after that, the rest of passengers will: *...
Given an array `nums` of positive integers, return the longest possible length of an array prefix of `nums`, such that it is possible to remove exactly one element from this...
A die simulator generates a random number from `1` to `6` for each roll. You introduced a constraint to the generator such that it cannot roll the number `i` more...
On an 8x8 chessboard, there can be multiple Black Queens and one White King. Given an array of integer coordinates `queens` that represents the positions of the Black Queens, and...
Balanced strings are those that have an equal quantity of `'L'` and `'R'` characters. Given a balanced string `s`, split it in the maximum amount of balanced strings. Return _the...
Given an integer `n`, your task is to count how many strings of length `n` can be formed under the following rules: * Each character is a lower case vowel ...