Swap Nodes in Pairs Given a linked list, swap every two adjacent nodes and return its head. For example, Given…
分类:LeetCode题目解答
[Leetcode] Combinations 组合数
Combinations Given two integers n and k, return all possible ombinations of k numbers out of 1 … n. For …
[Leetcode] Palindrome Number 回文数
Palindrome Number Determine whether an integer is a palindrome. Do this without extra space. 反转比较法 Reverse and…
【leetcode】104. Maximum Depth of Binary Tree
1. 题目 Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest …
[LeetCode] Convert Sorted Array to Binary Search Tree 将有序数组转为二叉搜索树
Given an array where elements are sorted in ascending order, convert it to a height balanced BST. For t…
210. Course Schedule II
There are a total of n courses you have to take, labeled from 0 to n-1. Some courses may have prerequisites, f…
[Leetcode] Merge Intervals and Insert Interval 合并间隔与插入间隔
Merge Intervals 最新更新请见 https://yanjia.me/zh/2019/02/… Given a collection of intervals, merge all overlap…
LeetCode题目汇总
我的博客:http://blog.csdn.net/yano_nankai LeetCode题解:https://github.com/LjyYano/LeetCode LeetCode之Array题目汇总 LeetCo…
LeetCode | Distinct Subsequences
题目: Given a string S and a string T, count the number of distinct subsequences of T i…
LeetCode 068 Text Justification
题目描述 Given an array of words and a length L, format the text such that each line has exactly L characters and …
[LeetCode] Super Ugly Number 超级丑陋数
Write a program to find the nth super ugly number. Super ugly numbers are positive numbers whose a…
95. Unique Binary Search Trees II
Given an integer n, generate all structurally unique BST’s (binary search trees) that store values 1 …