文章
1. Two Sum (Easy)
DescriptionGivenanarrayofintegers,returnindicesofthetwonumberssuchthattheyadduptoaspecifictarget.Youmayassumethateachinp
[LintCode/LeetCode] Remove Duplicate Letters
ProblemGivenastringwhichcontainsonlylowercaseletters,removeduplicateletterssothateveryletterappearonceandonlyonce.Youmust
LeetCode_4_两个排序数组的中位数
LeetCode_4_两个排序数组的中位数题目描述<code两个排序数组的中位数</code(https://link.segmentfault.com/?enco7IIHyx%2FgfhAmhll0BSCyw%3D%3D.uNnc5qpPbqQeEjpitYg
Count of Smaller Numbers After Self
315.CountofSmallerNumbersAfterSelf分析这道题第一反应用Bruteforce方法比较直接,两个ForLoop解决,时间复杂度是O(n^2),很显然我们需要用时间复杂度更低的方法。方法是在优化第二个ForLoop的时候,
[LeetCode] Two Sum IV - Input is a BST
ProblemGivenaBinarySearchTreeandatargetnumber,returntrueifthereexisttwoelementsintheBSTsuchthattheirsumisequaltotheg
[LeetCode] Maximum Binary Tree
ProblemGivenanintegerarraywithnoduplicates.Amaximumtreebuildingonthisarrayisdefinedasfollow:Therootisthemaximumnumberi
leetcode--两数之和(1)
1.给定一个整数数组和一个目标值,找出数组中和为目标值的两个数。你可以假设每个输入只对应一种答案,且同样的元素不能被重复利用。示例:给定nums2,7,11,15,target9因为nums0nums1279所以返回0,
[LeetCode] Find the Duplicate Number
ProblemGivenanarraynumscontainingn1integerswhereeachintegerisbetween1andn(inclusive),provethatatleastoneduplicatenumbe
leetcode347. Top K Frequent Elements
题目要求<pre<codeGivenanonemptyarrayofintegers,returnthekmostfrequentelements.Forexample,Given1,1,1,2,2,3andk2,return1
leetcode341. Flatten Nested List Iterator
题目要求<pre<codeGivenanestedlistofintegers,implementaniteratortoflattenit.Eachelementiseitheraninteger,oralistwhoseele
已加载文章中没有匹配内容,试试其他关键词或清空搜索。