51
Dev开发社区
首页
文章
问答
工具
搜索
登录
注册
#Etc
leetcode 349. Intersection of Two Arrays
Giventwoarrays,writeafunctiontocomputetheirintersection.Example:Given nums1 = [1,2,2,1], nums2 = [2,2],return [2].Note:Eachel...
代码星球
·
2021-01-23
leetcode
349.
Intersection
of
Two
leetcode 659. Split Array into Consecutive Subsequences
Youaregivenanintegerarraysortedinascendingorder(maycontainduplicates),youneedtosplitthemintoseveralsubsequences,whereeachsubsequencesconsistofatleast3consecutiv...
代码星球
·
2021-01-23
leetcode
659.
Split
Array
into
leetcode 658. Find K Closest Elements
Givenasortedarray,twointegers k and x,findthe k closestelementsto x inthearray.Theresultshouldalsobesortedinascendingorder.If...
代码星球
·
2021-01-23
leetcode
658.
Find
Closest
Elements
leetcode 657. Judge Route Circle
Initially,thereisaRobotatposition(0,0).Givenasequenceofitsmoves,judgeifthisrobotmakesacircle,whichmeansitmovesbackto theoriginalplace.Themovese...
代码星球
·
2021-01-23
leetcode
657.
Judge
Route
Circle
leetcode 179. Largest Number
Givenalistofnonnegativeintegers,arrangethemsuchthattheyformthelargestnumber.Forexample,given [3,30,34,5,9],thelargestformednumberis 9534330.Note:There...
代码星球
·
2021-01-23
leetcode
179.
Largest
Number
leetcode 660. Remove 9
Startfrominteger1,removeanyintegerthatcontains9suchas9,19,29...Sonow,youwillhaveanewintegersequence:1,2,3,4,5,6,7,8,10,11,...Givenapositiveinteger n,younee...
代码星球
·
2021-01-23
leetcode
660.
Remove
leetcode 442. Find All Duplicates in an Array
Givenanarrayofintegers,1≤a[i]≤ n (n =sizeofarray),someelementsappear twice andothersappear once.Findalltheelementsthatappear ...
代码星球
·
2021-01-23
leetcode
442.
Find
All
Duplicates
leetcode 405. Convert a Number to Hexadecimal
Givenaninteger,writeanalgorithmtoconvertittohexadecimal.Fornegativeinteger, two’scomplement methodisused.Note:Alllettersinhexadecimal(a-f)mustbeinlowe...
代码星球
·
2021-01-23
leetcode
405.
Convert
Number
to
leetcode 506. Relative Ranks
Givenscoresof N athletes,findtheirrelativeranksandthepeoplewiththetopthreehighestscores,whowillbeawardedmedals:"GoldMedal","SilverMedal"and"BronzeMeda...
代码星球
·
2021-01-23
leetcode
506.
Relative
Ranks
leetcode 316. Remove Duplicate Letters
Givenastringwhichcontainsonlylowercaseletters,removeduplicateletterssothateveryletterappearonceandonlyonce.Youmustmakesureyourresultisthesmallestinlexicographic...
代码星球
·
2021-01-23
leetcode
316.
Remove
Duplicate
Letters
leetcode 654. Maximum Binary Tree
Givenanintegerarraywithnoduplicates.Amaximumtreebuildingonthisarrayisdefinedasfollow:Therootisthemaximumnumberinthearray.Theleftsubtreeisthemaximumtreeconstruct...
代码星球
·
2021-01-23
leetcode
654.
Maximum
Binary
Tree
leetcode 653. Two Sum IV
GivenaBinarySearchTreeandatargetnumber,returntrueifthereexisttwoelementsintheBSTsuchthattheirsumisequaltothegiventarget.Example1:Input:5/36/247Target=9Output:Tr...
代码星球
·
2021-01-23
leetcode
653.
Two
Sum
IV
leetcode 656. Coin Path
Givenanarray A (indexstartsat 1)consistingofNintegers:A1,A2,...,AN andaninteger B.Theinteger B denotesthatfromanyplace(suppos...
代码星球
·
2021-01-23
leetcode
656.
Coin
Path
leetcode 258. Add Digits
Givenanon-negativeinteger num,repeatedlyaddallitsdigitsuntiltheresulthasonlyonedigit.Forexample:Given num=38,theprocessislike: 3+8=11, 1+1=2...
代码星球
·
2021-01-23
leetcode
258.
Add
Digits
leetcode 231. Power of Two
Givenaninteger,writeafunctiontodetermineifitisapoweroftwo.classSolution{public:boolisPowerOfTwo(intn){intnum=0;while(n>0){if(n&1)num++;n/=2;}if(num==1)re...
代码星球
·
2021-01-23
leetcode
231.
Power
of
Two
首页
上一页
...
21
22
23
24
25
...
下一页
尾页
按字母分类:
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
其他