题目描述 Given two integers n and k, return all possible combinations of k numbers out of 1 … n. For example, If n…
分类:LeetCode
[Leetcode] Substring with Concatenation of All Words 单词组合子字符串
Substring with Concatenation of All Words You are given a string, s, and a list of words, words, that are all …
[Leetcode] Implement strStr() 实现StrStr
Implement strStr() 最新更新:https://yanjia.me/zh/2019/02/… Implement strStr(). Returns the index of the firs…
【leetcode】95. Unique Binary Search Trees II 含有N个节点的中序遍历有序的二叉树集
1. 题目 Given an integer n, generate all structurally unique BST’s (binary search trees) that store values…
24. 两两交换链表中的节点(Swift版)
一、题目 给定一个链表,两两交换其中相邻的节点,并返回交换后的链表。 示例: 给定 1->2->3->4, 你应该返回 2->1->4->3. 说明: 你的算法只能使用常数的额外空间。…
788. Rotated Digits
题目地址:https://leetcode.com/problems/rotated-digits/description/ 题目大意: 比较绕人,就一个一数字,没个位数上的数字都旋转180度之后,还是一个数字,但是不能…
[LeetCode] Russian Doll Envelopes 俄罗斯娃娃信封
You have a number of envelopes with widths and heights given as a pair of integers (w, h). One envelope…
[LeetCode] Minimum Number of Arrows to Burst Balloons 最少数量的箭引爆气球
There are a number of spherical balloons spread in two-dimensional space. For each balloon, provided in…
[LeetCode] Maximum Average Subarray I 子数组的最大平均值
Given an array consisting of n integers, find the contiguous subarray of given length k&…
LeetCode | Palindrome Partitioning
题目: Given a string s, partition s such that every substring of the partition is a palindrome. R…
LeetCode 110 Balanced Binary Tree
题目描述 Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tree …
[Leetcode] Intersection of Two Linked Lists 链表交点
双指针法 复杂度 时间 O(N) 空间 O(1) 思路 先算出两个链表各自的长度,然后从较长的链表先遍历,遍历到较长链表剩余长度和较短链表一样时,用两个指针同时遍历两个链表。这样如果链表有交点的话,两个指针已经一定会相遇…