文章
[LeetCode] 280. Wiggle Sort
ProblemGivenanunsortedarraynums,reorderitinplacesuchthatnums0<nums1>nums2<nums3....Example:Input:nums
[LeetCode] 243. Shortest Word Distance
ProblemGivenalistofwordsandtwowordsword1andword2,returntheshortestdistancebetweenthesetwowordsinthelist.Example:Assumeth
[LeetCode] 487. Max Consecutive Ones II
ProblemGivenabinaryarray,findthemaximumnumberofconsecutive1sinthisarrayifyoucanflipatmostone0.Example1:Input:1,0,1,1,0
[LeetCode] 48. Rotate Image
ProblemYouaregivenannxn2Dmatrixrepresentinganimage.Rotatetheimageby90degrees(clockwise).Note:Youhavetorotatetheimage
[LeetCode] 41. First Missing Positive
ProblemGivenanunsortedintegerarray,findthesmallestmissingpositiveinteger.Example1:Input:1,2,0Output:3Example2:Input:3,4,
leetcode330. Patching Array
题目要求<pre<codeGivenasortedpositiveintegerarraynumsandanintegern,add/patchelementstothearraysuchthatanynumberinrange1,n
Array 的一些常用 API
unshift、push、shift、pop这4个方法都会改变原数组unshift()从前面添加元素,push()从后面追加元素,返回数组长度shift()删除第0个元素,pop()删除最后一个元素,返回被删除的元素slice不改变原
[LeetCode] 209. Minimum Size Subarray Sum (Easy version LC 862)
ProblemGivenanarrayofnpositiveintegersandapositiveintegers,findtheminimallengthofacontiguoussubarrayofwhichthesum≥s.If
[LeetCode] 548. Split Array with Equal Sum
ProblemGivenanarraywithnintegers,youneedtofindiftherearetriplets(i,j,k)whichsatisfiesfollowingconditions:0<i,i1&
[LeetCode] 852. Peak Index in a Mountain Array
ProblemLet&39;scallanarrayAamountainifthefollowingpropertieshold:A.length>3Thereexistssome0<i<A.length1such
已加载文章中没有匹配内容,试试其他关键词或清空搜索。