You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb …
分类:LeetCode
[LeetCode] Minimum Genetic Mutation 最小基因变化
A gene string can be represented by an 8-character long string, with choices from "A", "C",&n…
LeetCode 198 House Robber
题目描述 You are a professional robber planning to rob houses along a street. Each house has a certain amount of m…
222. Count Complete Tree Nodes
Given a complete binary tree, count the number of nodes. Note:Definition of a complete binary tree from Wikipe…
[Leetcode] Rotate Image 旋转图片
Rotate Image You are given an n x n 2D matrix representing an image. Rotate the image by 90 degrees (clockwise…
【leetcode】22. Generate Parentheses 合法括号串的所有组合
1. 题目 Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. …
力扣(LeetCode)78
题目地址:https://leetcode-cn.com/probl…题目描述:给定一组不含重复元素的整数数组 nums,返回该数组所有可能的子集(幂集)。 说明:解集不能包含重复的子集。 示例: 输入: n…
LeetCode刷题之路 按奇偶排序数组 II
按奇偶排序数组 II【简单】 给定一个非负整数数组 A, A 中一半整数是奇数,一半整数是偶数。 对数组进行排序,以便当 A[i] 为奇数时,i 也是奇数;当 A[i] 为偶数时, i 也是偶数。 你可以返回任何满足上述…
[LeetCode] Find Duplicate Subtrees 寻找重复树
Given a binary tree, return all duplicate subtrees. For each kind of duplicate subtrees, you only need …
LeetCode | Populating Next Right Pointers in Each Node
题目: Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; } P…
[Leetcode] Perfect Squares 完美平方数
Perfect Squares Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4…
LeetCode 337. House Robber III
The thief has found himself a new place for his thievery again. There is only one entrance to this area, calle…