文章
238. Product of Array Except Self
Givenanarraynumsofnintegerswheren>1,returnanarrayoutputsuchthatoutputiisequaltotheproductofalltheelementsofnumsexcep
229. Majority Element II
Givenanintegerarrayofsizen,findallelementsthatappearmorethan⌊n/3⌋times.Note:ThealgorithmshouldruninlineartimeandinO(1)spac
236. Lowest Common Ancestor of a Binary Tree
Givenabinarytree,findthelowestcommonancestor(LCA)oftwogivennodesinthetree.AccordingtothedefinitionofLCAonWikipedia:“Thelowe
299. Bulls and Cows
YouareplayingthefollowingBullsandCowsgamewithyourfriend:Youwritedownanumberandaskyourfriendtoguesswhatthenumberis.Eachtime
300. Longest Increasing Subsequence
Givenanunsortedarrayofintegers,findthelengthoflongestincreasingsubsequence.Example:<pre<codeInput:10,9,2,5,3,7,101,18Output:4E
304. Range Sum Query 2D - Immutable
Givena2Dmatrixmatrix,findthesumoftheelementsinsidetherectangledefinedbyitsupperleftcorner(row1,col1)andlowerrightcorner(row2
LeetCode 321. Create Maximum Number
DescriptionGiventwoarraysoflengthmandnwithdigits09representingtwonumbers.Createthemaximumnumberoflengthk<mnfromd
【Leetcode】102. 二叉树的层次遍历
题目给定一个二叉树,返回其按层次遍历的节点值。(即逐层地,从左到右访问所有节点)。例如:给定二叉树:3,9,20,null,null,15,7,<pre<code3/\920/\157</code</pre
109. Convert Sorted List to Binary Search Tree
Givenasinglylinkedlistwhereelementsaresortedinascendingorder,convertittoaheightbalancedBST.Forthisproblem,aheightbalancedbinar
230. Kth Smallest Element in a BST
Givenabinarysearchtree,writeafunctionkthSmallesttofindthekthsmallestelementinit.Note:Youmayassumekisalwaysvalid,1≤k≤BST&3
已加载文章中没有匹配内容,试试其他关键词或清空搜索。