-
给定一个字符串 S,通过将字符串 S 中的每个字母转变大小写,我们可以获得一个新的字符串。返回所有可能得到的字符串集合。
```
示例:
输入: S = "a1b2"
输出: ["a1b2", "a1B2", "A1b2", "A1B2"]
输入: S = "3z4"
输出: ["3z4", "3Z4"]
输入: S = "12345"
输出: ["12345"]
注…
-
__
Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand.
(i.e., `[0,1,2,4,5,6,7]` might become `[4,5,6,7,0,1,2]`).
Find the minimum element.
The array ma…
-
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 4-directionally connected group of `1`s).
Example 1:
…
-
win10 with ant 1.10.5 and git bash
-
## 🐛 Bug Report
Here is the log :
```
login: cookie: /home/zhaodachuan/.vscode-server/extensions/leetcode.vscode-leetcode-0.18.0/node_modules/vsc-leetcode-cli/lib/plugins/leetcode.js:542
retur…
-
Given the `root` of a binary tree, each node in the tree has a distinct value.
After deleting all nodes with a value in `to_delete`, we are left with a forest (a disjoint union of trees).
Retur…
-
[请点击下方图片观看讲解视频](https://www.youtube.com/watch?v=QzDIk92dQAw)
[Click below image to watch YouTube Video](https://www.youtube.com/watch?v=QzDIk92dQAw)
[![Video](https://img.youtube.com/vi/QzDIk92dQAw/0.…
-
给定一个正整数 n,生成一个包含 1 到 n2 所有元素,且元素按顺时针顺序螺旋排列的正方形矩阵。
```
示例:
输入: 3
输出:
[
[ 1, 2, 3 ],
[ 8, 9, 4 ],
[ 7, 6, 5 ]
]
```
来源:力扣(LeetCode)
链接:https://leetcode-cn.com/problems/spiral-matrix-ii
…
-
Given a non-empty 2D array `grid` of 0's and 1's, an island is a group of `1`'s (representing land) connected 4-directionally (horizontal or vertical.) You may assume all four edges of the grid are…
-
Given a binary tree, you need to find the length of Longest Consecutive Path in Binary Tree.
Especially, this path can be either increasing or decreasing. For example, [1,2,3,4] and [4,3,2,1] are …