当前位置:首页 » leetcode

leetcode

32
阅读

leetCode周赛106解题报告 javascript

比赛地址:https://leetcode-cn.com/contest/weekly-contest-106922.按奇偶排序数组II922.SortArrayByParityII给定一个非负整数数组 A,A中一半整数是奇数,一半整数是偶...
来源 2018-10-16 08:00
15
阅读

leetCode周赛102解题报告 javascript

比赛地址:https://lingkou.com/contest/weekly-contest-102 905.按奇偶校验排序数组905.SortArrayByParity给定一个非负整数数组 A,返回一个由 A 的所有偶数元素组成的...
来源 2018-09-18 17:01
18
阅读

leetCode周赛100解题报告 javascript

比赛地址:https://leetcode-cn.com/contest/weekly-contest-100 896.单调数列896.MonotonicArray如果数组是单调递增或单调递减的,那么它是单调的。如果对于所有 i=j,A[...
来源 2018-09-02 11:45
18
阅读

leetCode周赛98解题报告 javascript

比赛地址:https://leetcode-cn.com/contest/weekly-contest-98 888.公平的糖果交换888.FairCandySwap爱丽丝和鲍勃有不同大小的糖果棒:A[i] 是爱丽丝拥有的第 i 块糖的...
来源 2018-08-19 13:01
5
阅读

leetCode周赛97解题报告 javascript

比赛地址:https://leetcode-cn.com/contest/weekly-contest-97 888.两句话中的不常见单词888.UncommonWordsfromTwoSentences给定两个句子 A 和 B 。 (句子是一串由空格...
来源 2018-08-12 14:22
41
阅读

leetCode周赛96解题报告 javascript

比赛地址:https://leetcode-cn.com/contest/weekly-contest-96 887.ProjectionAreaof3DShapes887.三维形体投影面积在 N * N 的网格中,我们放置了一些与x,y,z三轴对齐...
来源 2018-08-05 12:41
31
阅读

leetCode周赛95解题报告 javascript

比赛地址https://leetcode-cn.com/contest/weekly-contest-95 876.MiddleoftheLinkedList876.链表的中间结点给定一个带有头结点 head 的非空单链表,返回链表的中间结点...
来源 2018-07-29 12:21
9
阅读

leetCode周赛94解题报告 javascript

比赛地址https://leetcode-cn.com/contest/weekly-contest-94 872.Leaf-SimilarTrees考虑一个二叉树的所有叶子。这些叶子的值按从左到右的顺序排列形成一个 叶值序列 。...
来源 2018-07-22 11:42
3
阅读

leetCode周赛93解题报告 javascript

比赛地址https://leetcode-cn.com/contest/weekly-contest-93 868.二进制间距给定一个正整数 N,找到并返回 N 的二进制表示中两个连续的1之间的最长距离。 如果没有两个...
来源 2018-07-15 13:01
1
阅读

leetCode周赛89解题报告 javascript

 比赛地址https://leetcode.com/contest/weekly-contest-89 852.PeakIndexinaMountainArray我们把符合下列属性的数组 A 称作山脉:A.length=3存在 0i A.length-1 使得A[0]...
来源 2018-06-17 12:22
5
阅读

leetcode-104.+Maximum+Depth+of+Binary+Tree

leetcode-104.MaximumDepthofBinaryTree题目:Givenabinarytree,finditsmaximumdepth.Themaximumdepthisthenumberofnodesalongthelongestpathfromtherootnodedowntothefar...
来源 2016-12-27 09:50
4
阅读

leetcode-103.+Binary+Tree+Zigzag+Level+Order+Traversal

leetcode-103.BinaryTreeZigzagLevelOrderTraversal题目:Givenabinarytree,returnthezigzaglevelordertraversalofitsnodes’values.(ie,fromlefttoright,thenrighttoleft...
来源 2016-12-27 09:48
4
阅读

leetcode-102.+Binary+Tree+Level+Order+Traversal

leetcode-102.BinaryTreeLevelOrderTraversal题目:Givenabinarytree,returnthelevelordertraversalofitsnodes’values.(ie,fromlefttoright,levelbylevel).Forexample:Gi...
来源 2016-12-27 09:46
2
阅读

leetcode-101.+Symmetric+Tree

leetcode-101.SymmetricTree题目:Givenabinarytree,checkwhetheritisamirrorofitself(ie,symmetricarounditscenter).Forexample,thisbinarytree[1,2,2,3,4,4,3]issymmetr...
来源 2016-12-26 10:13
2
阅读

leetcode-100.+Same+Tree

leetcode-100.SameTree题目:Giventwobinarytrees,writeafunctiontocheckiftheyareequalornot.Twobinarytreesareconsideredequaliftheyarestructurallyidenticalandthenod...
来源 2016-12-26 10:12
4
阅读

leetcode-99.+Recover+Binary+Search+Tree

leetcode-99.RecoverBinarySearchTree题目Twoelementsofabinarysearchtree(BST)areswappedbymistake.Recoverthetreewithoutchangingitsstructure.Note:AsolutionusingO(n)...
来源 2016-12-26 10:11
5
阅读

leetcode-98.+Validate+Binary+Search+Tree

leetcode-98.ValidateBinarySearchTree题目:Givenabinarytree,determineifitisavalidbinarysearchtree(BST).AssumeaBSTisdefinedasfollows:Theleftsubtreeofanodecontain...
来源 2016-12-26 10:08
4
阅读

leetcode-97.+Interleaving+String

leetcode-97.InterleavingString题目:Givens1,s2,s3,findwhethers3isformedbytheinterleavingofs1ands2.Forexample,Given:s1=“aabcc”,s2=“dbbca”,Whens3=“aadbbcbca...
来源 2016-12-26 10:04
4
阅读

leetcode-96.+Unique+Binary+Search+Trees

leetcode-96.UniqueBinarySearchTrees题目:Givenn,howmanystructurallyuniqueBST’s(binarysearchtrees)thatstorevalues1…n?Forexample,Givenn=3,thereareatotalof5uniq...
来源 2016-12-26 09:58
5
阅读

leetcode-95.+Unique+Binary+Search+Trees+II

leetcode-95.UniqueBinarySearchTreesII题目:Givenanintegern,generateallstructurallyuniqueBST’s(binarysearchtrees)thatstorevalues1…n.Forexample,Givenn=3,yourpr...
来源 2016-12-26 09:53
5
阅读

leetcode-94.+Binary+Tree+Inorder+Traversal

leetcode-94.BinaryTreeInorderTraversal题目:Givenabinarytree,returntheinordertraversalofitsnodes’values.Forexample:Givenbinarytree[1,null,2,3],1\2/3return[1,3...
来源 2016-12-26 09:45
4
阅读

leetcode-93.+Restore+IP+Addresses

leetcode-93.RestoreIPAddresses题目:Givenastringcontainingonlydigits,restoreitbyreturningallpossiblevalidIPaddresscombinations.Forexample:Given“25525511135”,...
来源 2016-12-26 09:40
5
阅读

leetcode-92.+Reverse+Linked+List+II

leetcode-92.ReverseLinkedListII题目:Reversealinkedlistfrompositionmton.Doitin-placeandinone-pass.Forexample:Given1-2-3-4-5-NULL,m=2andn=4,return1-4-3-2-5-NULL...
来源 2016-12-26 09:36
4
阅读

leetcode-91.+Decode+Ways

leetcode-91.DecodeWays题目:AmessagecontaininglettersfromA-Zisbeingencodedtonumbersusingthefollowingmapping:‘A’-1‘B’-2…‘Z’-26Givenanencodedmessagecontai...
来源 2016-12-26 09:32
2
阅读

LeetCode题解(1)--Two+Sum

Givenanarrayofintegers,returnindicesofthetwonumberssuchthattheyadduptoaspecifictarget.Youmayassumethateachinputwouldhaveexactlyonesolution.example[code]Givennu...
来源 2016-12-25 15:58