常梦网 Tag标签 [nums]如下:
当前位置:网站首页>-
First Missing Positive - 每日算法
2024-05-11Difficulty:Hard
-
Find Peak element leetcode - Ryan的修炼之路
2024-05-11Apeakelementisanelementthatisgreaterthanitsneighbors.
-
Supposeasortedarrayisrotatedatsomepivotunknowntoyoubeforehand.
-
Boyer-Moore 算法
2024-03-28给定一个长度为n的数组:int[]nums其中有一个数,它出现的次数大于n/2,称为主要元素,找到它。看起来不算是个难题,但好玩。这是一个投票问题,可以模拟我们在投票表决时的计票过程。用一个hashtable或者dictionary,数组中的数作为key,它们出现的次数为value。本文想讨论的是下…
-
3Sum Closest - 每日算法
2024-03-13Difficulty:Medium
-
3Sum - 每日算法
2024-03-13Difficulty:Medium
-
Givenasequenceofintegers,findthelongestincreasingsubsequence(LIS).
-
给定一个整数序列,找到最长上升子序列(LIS),返回LIS的长度。
-
[Lintcode] Data Stream Median 数据流中位数
2024-02-09Numberskeepcoming,returnthemedianofnumbersateverytimeanewnumberadded.
-
[Lintcode] Find Peak Element 找峰值
2024-02-09Apeakelementisanelementthatisgreaterthanitsneighbors.
-
[LeetCode]Sliding Window Maximum - EpoTalk
2024-02-08Givenanarraynums,thereisaslidingwindowofsizekwhichismovingfromtheveryleftofthearraytotheveryright.Youcanonlyseetheknumbersinthewindow.Eachtimetheslidingwindowmovesrightbyoneposition.
-
[LeetCode]Find Peak Element - EpoTalk
2024-02-05Apeakelementisanelementthatisgreaterthanitsneighbors.
-
[Leetcode] Wiggle Sort 摇摆排序
2024-02-03Givenanunsortedarraynums,reorderitin-placesuchthatnums[0]=nums[1]=nums[2]=nums[3]....
-
[Leetcode] Summary Ranges 统计区间
2024-02-02Givenasortedintegerarraywithoutduplicates,returnthesummaryofitsranges.
-
[Leetcode] Sort Colors 颜色排序
2024-02-01Givenanarraywithnobjectscoloredred,whiteorblue,sortthemsothatobjectsofthesamecolorareadjacent,withthecolorsintheorderred,whiteandblue.
-
[Leetcode] Sliding Window Maximum 滑动窗口最大值
2024-02-01Givenanarraynums,thereisaslidingwindowofsizekwhichismovingfromtheveryleftofthearraytotheveryright.Youcanonlyseetheknumbersinthewindow.Eachtimetheslidingwindowmovesrightbyoneposition.
-
[Leetcode] Single Number 单身数
2024-02-01Givenanarrayofnumbersnums,inwhichexactlytwoelementsappearonlyonceandalltheotherelementsappearexactlytwice.Findthetwoelementsthatappearonlyonce.
-
[Leetcode] Search Insert Position 搜索插入位置
2024-01-31时间O(logN)空间O(1)
-
Supposeasortedarrayisrotatedatsomepivotunknowntoyoubeforehand.
-
[Leetcode] Search for a Range 寻找区间
2024-01-31Givenasortedarrayofintegers,findthestartingandendingpositionofagiventargetvalue.
-
[Leetcode] Reverse Array 反转数组
2024-01-30Rotateanarrayofnelementstotherightbyksteps.
-
Givenasortedarray,removetheduplicatesinplacesuchthateachelementappearonlyonceandreturnthenewlength.
-
Givenanarrayofnintegerswheren1,nums,returnanarrayoutputsuchthatoutput[i]isequaltotheproductofalltheelementsofnumsexceptnums[i].
-
[Leetcode] Permutations 置换
2024-01-28时间O(N)空间O(N)递归栈
-
[Leetcode] Next Permutation 下一个排列
2024-01-26Implementnextpermutation,whichrearrangesnumbersintothelexicographicallynextgreaterpermutationofnumbers.
-
[Leetcode] Move Zeroes 移动零
2024-01-26Givenanarraynums,writeafunctiontomoveall0'stotheendofitwhilemaintainingtherelativeorderofthenon-zeroelements.
-
Givenanarraycontainingndistinctnumberstakenfrom0,1,2,...,n,findtheonethatismissingfromthearray.
-
[Leetcode] Minimum Size Subarray Sum 最短子串和
2024-01-25Givenanarrayofnpositiveintegersandapositiveintegers,findtheminimallengthofasubarrayofwhichthesum≥s.Ifthereisn'tone,return0instead.
-
[Leetcode] Merged Sorted Array 合并数组
2024-01-25Giventwosortedintegerarraysnums1andnums2,mergenums2intonums1asonesortedarray.
-
[Leetcode] Maximum Subarray 子序列最大和
2024-01-25Findthecontiguoussubarraywithinanarray(containingatleastonenumber)whichhasthelargestsum.