Given a range [m, n] where 0 <= m <= n <= 2147483647, return the bitwise AND of all numbers in…
分类:LeetCode题目解答
[LeetCode] Course Schedule 课程清单, Clone Graph 无向图的复制
There are a total of n courses you have to take, labeled from 0 to n - 1. Some…
LeetCode | Search in Rotated Sorted Array II
题目: Follow up for “Search in Rotated Sorted Array”: What if duplicates are allowed? Woul…
LeetCode | Edit Distance
题目: Given two words word1 and word2, find the minimum number of steps required to convert …
[Algo] Maximum Expression Value 表达式最大值
Maximum Expression Value I 给定一个整数数组,要求在数字之间任意添加乘号,加号和括号,使得最后表达式结果最大。比如1121,最大值为(1+1)*(2+1),所有数字都是正数。 动态规划 复杂度 …
【leetcode】69. Sqrt(x) 整数开方计算最合适的小的数
1. 题目 Implement int sqrt(int x). Compute and return the square root of x. 注:对于5,6,7,8等都返回2. 2. 思路 用牛顿开方法计算。原理:…
[LeetCode] Word Search II 词语搜索之二,Word Search 词语搜索,Add and Search Word - Data structure design 添加和查找单词-数据结构设计,Word Search 词语搜索
Given a 2D board and a list of words from the dictionary, find all words in the board. Each word must b…
[LeetCode] Alien Dictionary 另类字典
There is a new alien language which uses the latin alphabet. However, the order among letters are unkno…
[LeetCode] Path Sum III 二叉树的路径和之三
You are given a binary tree in which each node contains an integer value. Find the number of paths that…
[LeetCode] Binary Tree Longest Consecutive Sequence II 二叉树最长连续序列之二
Given a binary tree, you need to find the length of Longest Consecutive Path in Binary Tree. Especially…
LeetCode 080 Remove Duplicates from Sorted Array II
题目描述 Follow up for “Remove Duplicates”: What if duplicates are allowed at most twice? For example, Given sorte…
[Lintcode] Find Peak Element 找峰值
Find Peak Element I A peak element is an element that is greater than its neighbors. Given an input array wher…