Next Permutation Implement next permutation, which rearranges numbers into the lexicographically next greater …
分类:LeetCode题目解答
[Leetcode] Delete Node/Remove Element in a Linked List 删除链表节点
Delete Node in a Linked List Write a function to delete a node (except the tail) in a singly linked list, give…
【Leetcode】13. Roman to Integer 罗马数字转阿拉伯数字
1. 题目 Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 to 39…
[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] 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…