-
[综合] LeetCode 219. Contains Duplicate II
ContainsDuplicateII 题目描述: Givenanarrayofintegersandanintegerk,findoutwhethertherearetwodistinctindicesiandjinthearraysuchthatnums[i]=nums[j]andtheab...
43
热度 -
[综合] LeetCode 448. Find All Numbers Disappeared in an Array
FindAllNumbersDisappearedinanArray 题目描述: Givenanarrayofintegerswhere1≤a[i]≤n(n=sizeofarray),someelementsappeartwiceandothersappearonce. Findalltheel...
54
热度 -
[综合] LeetCode 442. Find All Duplicates in an Array
FindAllDuplicatesinanArray 题目描述: Givenanarrayofintegers,1≤a[i]≤n(n=sizeofarray),someelementsappeartwiceandothersappearonce. Findalltheelementsthatap...
108
热度 -
[综合] LeetCode 605. Can Place Flowers
CanPlaceFlowers 题目描述: Supposeyouhavealongflowerbedinwhichsomeoftheplotsareplantedandsomearenot.However,flowerscannotbeplantedinadjacentplots-theywoul...
36
热度 -
[综合] LeetCode 661. Image Smoother
ImageSmoother 题目描述: Givena2DintegermatrixMrepresentingthegrayscaleofanimage,youneedtodesignasmoothertomakethegrayscaleofeachcellbecomestheaveragegra...
26
热度 -
[综合] LeetCode 665. Non-decreasing Array
Non-decreasingArray 题目描述: Givenanarraywithnintegers,yourtaskistocheckifitcouldbecomenon-decreasingbymodifyingatmost1element. Wedefineanarrayisnon-dec...
62
热度 -
[综合] LeetCode 667. Beautiful Arrangement II
BeautifulArrangementII 题目描述: Giventwointegersnandk,youneedtoconstructalistwhichcontainsndifferentpositiveintegersrangingfrom1tonandobeysthefollowing...
87
热度 -
[综合] LeetCode 39. Combination Sum
CombinationSum 题目描述: Givenasetofcandidatenumbers(C)(withoutduplicates)andatargetnumber(T),findalluniquecombinationsinCwherethecandidatenumberssumsto...
92
热度 -
[综合] LeetCode 40. Combination Sum II
CombinationSumII 题目描述: Givenacollectionofcandidatenumbers(C)andatargetnumber(T),findalluniquecombinationsinCwherethecandidatenumberssumstoT. Eachnum...
95
热度 -
[综合] LeetCode 216. Combination Sum III
CombinationSumIII 题目描述: Findallpossiblecombinationsofknumbersthatadduptoanumbern,giventhatonlynumbersfrom1to9canbeusedandeachcombinationshouldbeauni...
95
热度 -
[综合] LeetCode 142. Linked List Cycle II
LinkedListCycleII 题目思路 判断给定链表中是否存在环,如果存在环返回环的起点。 参考这篇文章。 题目代码: /***Definitionforsingly-linkedlist.*structListNode{*intval;*ListNode*next;*ListNode(...
89
热度 -
[综合] LeetCode 290. Word Pattern
WordPattern 题目描述: Givenapatternandastringstr,findifstrfollowsthesamepattern. Herefollowmeansafullmatch,suchthatthereisabijectionbetweenaletterinpatte...
59
热度 -
[综合] LeetCode 409. Longest Palindrome
LongestPalindrome 题目描述: Givenastringwhichconsistsoflowercaseoruppercaseletters,findthelengthofthelongestpalindromesthatcanbebuiltwiththoseletters. T...
145
热度 -
[综合] PAT - 甲级 - 1079. Total Sales of Supply Chain (25)(DFS,遍历树)
Asupplychainisanetworkofretailers(零售商),distributors(经销商),andsuppliers(供应商)--everyoneinvolvedinmovingaproductfromsuppliertocustomer. Startingfromoneroo...
93
热度 -
[综合] PAT - 甲级 - 1090. Highest Price in Supply Chain (25)(树的遍历DFS)
Asupplychainisanetworkofretailers(零售商),distributors(经销商),andsuppliers(供应商)--everyoneinvolvedinmovingaproductfromsuppliertocustomer. Startingfromoneroo...
89
热度 -
[综合] PAT - 甲级 - 1062. Talent and Virtue (25)(排序)
About900yearsago,aChinesephilosopherSimaGuangwroteahistorybookinwhichhetalkedaboutpeople'stalentandvirtue.Accordingtohistheory,amanbeingoutstandinginb...
100
热度 -
[综合] PAT - 甲级 - 1091. Acute Stroke (30)(三维BFS)
Oneimportantfactortoidentifyacutestroke(急性脑卒中)isthevolumeofthestrokecore.GiventheresultsofimageanalysisinwhichthecoreregionsareidentifiedineachMRIslic...
106
热度 -
[综合] PAT - 甲级 - 1074. Reversing Linked List (25)(链表)
GivenaconstantKandasinglylinkedlistL,youaresupposedtoreversethelinksofeveryKelementsonL.Forexample,givenLbeing1→2→3→4→5→6,ifK=3,thenyoumustoutput3→2→1...
78
热度 -
[综合] JavaScript slice()和substring()的区别
Syntax:string.slice(start,stop); Syntax:string.sunstring(start,stop); 两者的相同点 如果start等于end,返回空字符串 如果stop参数省略,则取到字符串末 如果某个参数超过string的长度,这个参数会被替换为stri...
114
热度 -
[综合] About bash_profile and bashrc on macOS
Note:bash_profileiscompletelydifferentfromconfigurationprofiles.LearnmoreaboutConfigurationProfilesinmybook:‘PropertyLists,PreferencesandProfilesforAp...
59
热度