文章
344 Reverse String
<blockquoteWriteafunctionthattakesastringasinputandreturnsthestring<br/reversed.<pExample1:</p<pInput:&34;hello&34;Output:&34
Pascal's Triangle I&II
118Pascal&39;sTriangle思路把三角分为三种情况,第一个1是每一行都有的,结尾的1是从第二行才开始有,然后中间的数字是从第三行开始,对于i位置的数字是他前一行的i位置和i1位置数字的和复杂度时间O(n^2)空间O(n
Spiral Matrix I & II
SpiralMatrix<blockquoteGivenamatrixofmxnelements(mrows,ncolumns),returnall<br/elementsofthematrixinspiralorder.<pExample
javescript经验文档(Array篇)
数组去重...set(array)去重<pre<code{letarray&39;aa&39;,12,&39;aa&39;,16,12,&39;ab&39;;functiondedupe(array)
498. Diagonal Traverse
<blockquoteGivenamatrixofMxNelements(Mrows,Ncolumns),returnall<br/elementsofthematrixindiagonalorderasshowninthebelowimage.
66 Plus One
<blockquote<pGivenanonemptyarrayofdigitsrepresentinganonnegativeinteger,<br/plusonetotheinteger.</p<pThedigitsarestoredsuch
747 Largest Number At Least Twice of Others
<blockquote<pInagivenintegerarraynums,thereisalwaysexactlyonelargest<br/element.</p<pFindwhetherthelargestelementinthearrayi
724. Find Pivot Index
FindPivotIndex<blockquoteGivenanarrayofintegersnums,writeamethodthatreturnsthe<br/&34;pivot&34;indexofthisarray.</blockquo
[LeetCode] String Compression
ProblemGivenanarrayofcharacters,compressitinplace.Thelengthaftercompressionmustalwaysbesmallerthanorequaltotheoriginala
[LeetCode] Third Maximum Number
ProblemGivenanonemptyarrayofintegers,returnthethirdmaximumnumberinthisarray.Ifitdoesnotexist,returnthemaximumnumber.The
已加载文章中没有匹配内容,试试其他关键词或清空搜索。