According to the Wikipedia’s article: “The Game of Life, also known simply as&nbs…
分类:LeetCode题目解答
[LeetCode] Water and Jug Problem 水罐问题
You are given two jugs with capacities x and y litres. There is an infinite amount of water supply avai…
LeetCode 268 Missing Number
题目描述 Given an array containing n distinct numbers taken from 0, 1, 2, …, n, find the one that is missing from …
100. Same Tree
100. Same Tree 题目 Given two binary trees, write a function to check if they are the same or not. Two binary tr…
力扣(LeetCode)22
题目地址:https://leetcode-cn.com/probl…题目描述:给出 n 代表生成括号的对数,请你写出一个函数,使其能够生成所有可能的并且有效的括号组合。 例如,给出 n = 3,生成结果为:…
35. Search Insert Position
35. Search Insert Position 题目 Given a sorted array and a target value, return the index if the target is found…
[LeetCode] Guess Number Higher or Lower II 猜数字大小之二
We are playing the Guess Game. The game is as follows: I pick a number from 1 to …
[LeetCode] 2 Keys Keyboard 两键的键盘
Initially on a notepad only one character ‘A’ is present. You can perform two operations on…
[LeetCode] Subsets II 子集合之二
Given a collection of integers that might contain duplicates, S, return all possible subsets. Note…
[LeetCode] Queue Reconstruction by Height 根据高度重建队列
Suppose you have a random list of people standing in a queue. Each person is described by a pair of int…
[LeetCode] Number of Atoms 原子的个数
Given a chemical formula (given as a string), return the count of each atom. An atomic elemen…
[LeetCode] Number Of Corner Rectangles 边角矩形的数量
Given a grid where each entry is only 0 or 1, find the number of corner rectangles. A corner recta…