leetcode
leetcode copied to clipboard
Provide all my solutions and explanations in Chinese for all the Leetcode coding problems.
We have `n` jobs, where every job is scheduled to be done from `startTime[i]` to `endTime[i]`, obtaining a profit of `profit[i]`. You're given the `startTime`, `endTime` and `profit` arrays, return...
You are given a string containing only 4 kinds of characters `'Q',` `'W', 'E'` and `'R'`. A string is said to be balancedif each of its characters appears `n/4` times...
Given a list of folders `folder`, return _the folders after removing all sub-folders in those folders_. You may return the answer in any order. If a `folder[i]` is located within...
You are given an array `coordinates`, `coordinates[i] = [x, y]`, where `[x, y]` represents the coordinate of a point. Check if these points make a straight line in the XY...
Given a non-empty string containing an out-of-order English representation of digits `0-9`, output the digits in ascending order. Note: 1. Input contains only lowercase English letters. 2. Input is guaranteed...
There are a total of _n_ courses you have to take, labeled from `0` to `n-1`. Some courses may have prerequisites, for example to take course 0 you have to...
Given a non-empty string `s` and an abbreviation `abbr`, return whether the string matches with the given abbreviation. A string such as `"word"` contains only the following valid abbreviations: ["word",...
There is a new alien language which uses the latin alphabet. However, the order among letters are unknown to you. You receive a list of non-empty words from the dictionary,...
You are given a _m x n_ 2D grid initialized with these three possible values. 1. `-1` \- A wall or an obstacle. 2. `0` \- A gate. 3. `INF`...
There's a tree, a squirrel, and several nuts. Positions are represented by the cells in a 2D grid. Your goal is to find the minimal distance for the squirrel to...