[Leetcode] Maximum Subarray 子序列最大和
2024-01-25Findthecontiguoussubarraywithinanarray(containingatleastonenumber)whichhasthelargestsum.
Givenabinarytree,finditsmaximumdepth.
[Leetcode] Maximal Square 最大正方形
2024-01-24Givena2Dbinarymatrixfilledwith0'sand1's,findthelargestsquarecontainingall1'sandreturnitsarea.
[Leetcode] Max Points on a Line 线上最大点数
2024-01-24Givennpointsona2Dplane,findthemaximumnumberofpointsthatlieonthesamestraightline.
[Leetcode] Majority Element 众数
2024-01-24Givenanarrayofsizen,findthemajorityelement.Themajorityelementistheelementthatappearsmorethan⌊n/2⌋times.
[Leetcode] LRU Cache 最近使用缓存
2024-01-24DesignandimplementadatastructureforLeastRecentlyUsed(LRU)cache.Itshouldsupportthefollowingoperations:getandset.
Givenabinarysearchtree(BST),findthelowestcommonancestor(LCA)oftwogivennodesintheBST.
Givenastringcontainingjustthecharacters'('and')',findthelengthofthelongestvalid(well-formed)parenthesessubstring.
时间O(N)空间O(1)
Givenanunsortedarrayofintegers,findthelengthofthelongestconsecutiveelementssequence.

