Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

My CS learning : algorithm, data structure, and system design | #SE

NotificationsYou must be signed in to change notification settings

yennanliu/CS_basics

Repository files navigation

Star History Chart

Resource

Algorithms content

Database

Shell


Progress

Data Structure

#TitleSolutionUse caseCommentStatus
Linear
ArrayPyAGAIN*
QueuePy,JSAGAIN*
StackPy,JS (linkedlist),JS (array)OK
Hash tablePy,JSusually for improvingtime complexity B(O) via extra space complexity (time-space tradeoff)good basicAGAIN****
Linear, Pointer
LinkedListPy,JS,JavaOK**
Doubly LinkedListPython,JSAGAIN
Non Linear, Pointer
TreePyAGAIN**
Binary search Tree (BST)Python,JS,JavaAGAIN
Binary TreePyAGAIN**
TriePyAGAIN
Heapheap.py,MinHeap.py,MaxHeap.py,MinHeap.java,MaxHeap.javaAGAIN
Priority Queue (PQ)Py 1,Py 2,Py 3AGAIN
Graph
GraphPy,JS.Java1,Java2OK***
DirectedEdgeJavaAGAIN

Algorithm

#TitleSolutionUse caseCommentTime complexitySpace complexityStatus
Binary searchPythoncomplexity refBest : O(1), Avg : O(log N), Worst : O(log N)AGAIN
Linear searchPythonAGAIN
Breadth-first search (BFS)PythonFIND SHORTEST PATHAGAIN***
Depth-first search (DFS)PythonTO CHECK IF SOMETHING EXISTinorder,postorder,postorder (can recreate a tree)AGAIN***
Bubble sortPythonOK* (3)
Insertion sortPython,InsertionSort.javastable sortwork very fast fornearly sorted arrayBest :O(n), Average : O(n^2), Worst : O(n^2)Worst : O(1)AGAIN
Bucket sortPython,BucketSort.javaAGAIN
Quick sortquick_sort.py,quick_sort_v2.py,QuickSort.java,QuickSortV2.java,QuickSortV3.javaNOTE !!!,avg is NLogN, worst is N**2,big O ref,big O ref 2Best : O(N Log N), Avg : O(N Log N), Worst : O(N^2)AGAIN***
Heap sortPythonbig O refBest : O(N Log N), Avg : O(N Log N), Worst : O(N Log N)AGAIN**
Merge sortmerge_sort_topdown.py,mergesort_bottomup.py,MergeSortTopDown.java,MergeSort.javaSQLBest : O(N Log N), Avg : O(N Log N), Worst : O(N Log N)O(N)OK* (2)
Pancake sortPythonAGAIN
Selection sortPython,JSAGAIN
Topological sortPython,Java,Java V2Topological Sort is a algorithm can find "ordering" on an "order dependency" graphAGAIN
md5PythonAGAIN
Union FindPython 1,Python 2,Java 1,Java 2,Java 3AGAIN
Dynamic programmingJS 1,fibonacci_dp JSAGAIN
DijkstraPython,Java 1,Java 2AGAIN***
Floyd-WarshallPythonnot start
Bellman-FordPythonnot start
Quick FindPython,Javainit : O(N), union : O(N), find : O(1)simple, but slowAGAIN
Quick UnionJava,Java v2init : O(N), union : O(N), find : O(N)lazy approach, route compression, optimized Quick FindAGAIN
Quick Union (Improvements)lazy approach, path compressionAGAIN
Priority Queue (unsorted)JavaAGAIN
LRU cachePythonLC 146AGAIN
LFU CachePythonLC 460AGAIN
DifferenceArrayJavaLC 1109, 370AGAIN
Kadane AlgoJavaLC 53, 152,918AGAIN

Array

#TitleSolutionTimeSpaceDifficultyNoteStatus
0153 SumPython,JavaO(n^2)O(1)MediumCurated Top 75, good basic, check with# 001 Two Sum,#018 4 sum,Two Pointers,good basic,amazon,fbOK******* (7)
0163 Sum ClosestPythonO(n^2)O(1)MediumTwo Pointers,basic,good trick,3 sum,google, fb, apple, m$, GS, amazonAGAIN**** (2)
0184 SumPythonO(n^3)O(1)Mediumk sum,Two Pointers, check#016 3 sum,# 454 4 SUM II,good trick,fbAGAIN******** (4)
026Remove Duplicates from Sorted ArrayPython,Scala,JavaO(n)O(1)EasyMUST,Two Pointers,basic,good trick,M$ ,fbAGAIN************** (11)
027Remove ElementPython,JavaO(n)O(1)EasyMUST,2 pointers,amazonOK* (2)
031Next PermutationPython,Scala,JavaO(n)O(1)Mediumgood trick, check, 2 pointers, Uber, GS,google,amazon,fbAGAIN****************** (8) (MUST)
041First Missing PositivePython,JavaO(n)O(1)Hardgood trick, hash key , array, LC top 100 like,amazon,fb, google, apple, uberOK** (2)
048Rotate ImagePython,JavaO(n^2)O(1)MediumCurated Top 75,basic,i,j->j,itranspose matrix, garena,amazon,appleAGAIN************* (5) (MUST)
054Spiral MatrixPython,JavaO(m * n)O(1)MediumCurated Top 75, good basic, array boundary, matrix,amazonAGAIN**** (4)
057Insert IntervalPython,JavaMediumCurated Top 75, good basic,056 Merge Intervals, java array, list basicAGAIN********** (5) (MUST!)
059Spiral Matrix IIPythonO(n^2)O(1)Mediumcheck# 054 Spiral Matrix,amazonAGAIN** (2)
066Plus OnePython,JavaO(n)O(1)Easybasic,digit,googleAGAIN** (3)
073Set Matrix ZeroesPython,JavaO(m * n)O(1)MediumCurated Top 75,matrix,amazonOK* (4)
080Remove Duplicates from Sorted Array IIPython,JavaO(n)O(1)Mediumtwo pointers,AGAIN,basic,trick,fb,#26 Remove Duplicates from Sorted ArrayAGAIN************ (8)
118Pascal's TrianglePythonO(n^2)O(1)Easytrick,basicAGAIN** (2)
119Pascal's Triangle IIPythonO(n^2)O(1)Easyarray, check with# 118 Pascal's Triangle,amazonOK** (4)
121Best Time to Buy and Sell StockPython,JavaO(n)O(1)EasyCurated Top 75,dp,basic,greedy,UBER,M$,amazon,fbOK****** (7) (but again)
157Read N Characters Given Read4PythonO(n)O(1)Easy🔒, buffer,google,amazon,fbAGAIN**** (3)
163Missing RangesPython,JavaO(n)O(1)Mediumtwo pointer, 🔒,google,amazonOK******* (4)
169Majority ElementPython,JavaO(n)O(1)EasyamazonOK*
189Rotate ArrayPython,JavaO(n)O(1)Mediumarray, k % len(nums), good basic,amazonOK* (7) (but again)
209Minimum Size Subarray SumPython,JavaO(n)O(1)Mediumgood basic, sliding window,Binary Search,trick,2 pointers,fbOK********** (7) (but again)
215Kth Largest Element in an ArrayPython,JavaO(n) ~O(n^2)O(1)MediumEPI,quick sort, bubble sort, sort,amazon,fbOK* (2)
228Summary RangesPython,JavaO(n)O(1)Easycheck# 163 Missing Ranges,basic, array,googleOK*** (4)
229Majority Element IIPython,JavaO(n)O(1)MediumOK
238Product of Array Except SelfPython,JavaO(n)O(1)MediumCurated Top 75, left, right array, LintCode,good trick,Apple,M$,amazon,fbOK******* (but again)(6)
240Search a 2D Matrix IIPythonO(m + n)O(1)MediumLintCode,basic,matrix,trick,binary search, check# 74 Search a 2D Matrix,amazon,appleOK***** (7) (but again)
243Shortest Word DistancePython,JavaO(n)O(1)Easy🔒,basicOK*
245Shortest Word Distance IIIPythonO(n)O(1)Medium🔒, checkShortest Word Distance I II IIIOK*
251Flatten 2D VectorPython,JavaO(1)O(1)Medium🔒,good basic, check# 341 Flatten Nested List Iterator,google,airbnb,twitter,amazonAGAIN******** (4)
277Find the CelebrityPythonO(n)O(1)Mediumgraph, 🔒,fb,amazon,trickAGAIN********** (5)
287Find the Duplicate NumberPython,JavaMediumgood trick,binary search, cycle linked list, check# 142 Linked List Cycle II,amazonOK* (2)
289Game of LifePythonO(m * n)O(1)Mediumsimultaneous,matrix,complex,google,amazonAGAIN*** (4)
293Flip GamePythonO(n * (c+1))O(1)Easy🔒,basicAGAIN*
308Range Sum Query 2D - MutablePythonO(n * (c+1))O(1)HardLC 303, pre-sum, matrix, tree, 🔒,googlenot start
311Sparse Matrix MultiplicationPython,JavaO(m * n * l)O(m * l)Medium🔒, matrix,basic,fb,googleOK**** (5)
334Increasing Triplet SubsequencePython,JavaO(n)O(1)MediumAGAIN, check# 300 Longest Increasing Subsequence,trick,fb, googleOK***** (but again) (4)
335Self CrossingJavaO(n)O(1)HardArray, geometry, googleAgain (not start)
370Range AdditionPython,JavaO(k + n)O(1)Mediumprefix, diff array, check# 598 Range Addition II,amazon, LC 1109, LC 1094, googleAGAIN************** (4) (MUST)
384Shuffle an ArrayPythonO(n)O(n)MediumEPI,trickOK*
396Rotate FunctionPythonO(n)O(1)Mediumcan pass, math,trick,amazonAGAIN*** (3)
412Fizz BuzzPython,ScalaO(n)O(1)EasyOK
414Third Maximum NumberPythonO(n)O(1)Easygood basic,amazonOK* (4)
419Battleships in a BoardPythonO(m * n)O(1)MediumAGAIN*
422Valid Word SquarePythonO(m * n)O(1)Easy🔒,basic,matrixAGAIN*
442Find All Duplicates in an ArrayPythonO(n)O(1)MediumOK*
448Find All Numbers Disappeared in an ArrayPythonO(n)O(1)EasyOK
498Diagonal TraversePython,JavaO(n)O(1)Mediummatrix,google,fbAGAIN*** (4)
531Lonely Pixel IPythonO(m * n)O(m + n)Medium🔒,matrix,basicAGAIN*
533Lonely Pixel IIPythonO(m * n)O(m * n)Medium🔒AGAIN (not start*)
565Array NestingPythonO(n)O(1)Mediumunion find,dfs,appleAGAIN**** (1)
566Reshape the MatrixPythonO(m * n)O(m * n)Easybasic,matrixAGAIN**
581Shortest Unsorted Continuous SubarrayPythonO(n)O(1)EasybasicAGAIN*
605Can Place FlowersPythonO(n)O(1)Easypass vs continueOK*
624Maximum Distance in ArraysPythonO(n)O(1)Easy🔒AGAIN*
643Maximum Average Subarray IPythonO(n)O(1)EasyMath,basicAGAIN*
661Image SmootherPythonO(m * n)O(1)Easymatrix,basic,amazonOK***** (4) (but again!)
665Non-decreasing ArrayPythonO(n)O(1)EasyAGAIN (not start)
667Beautiful Arrangement IIPythonO(n)O(1)MediumAGAIN (not start)
670Maximum SwapPythonO(logn)O(logn)Mediumgood basic, reversed, str -> list,string + pointers ,fbAGAIN************ (9) (MUST)
674Longest Continuous Increasing SubsequencePython,JavaO(n)O(1)Easygood basic,dp,2 pointers ,array ,fbOK*** (5)
697Degree of an ArrayPythonO(n)O(n)EasyAGAIN (not start)
713Subarray Product Less Than KPythonO(n)O(1)Mediumbasic,sliding window, good trickOK****** (3) (but again)
7171-bit and 2-bit CharactersPythonO(n)O(1)EasyGreedyAGAIN (not start)
723Candy CrushPythonO((R * C)^2)O(1)MediumcomplexAGAIN (not start)
724Find Pivot IndexPythonO(n)O(1)EasyOK*
729My Calendar IPython,JavaO(nlogn)O(n)Mediumgood basic, brute force, binary search, googleAGAIN**** (1)
731My Calendar IIPython,JavaO(n^2)O(n)Mediumtrick, good trick, scanning line, google,AGAIN******** (4)
747Largest Number At Least Twice of OthersPythonO(n)O(1)Easygood basic,data structureOK*
755Pour WaterPythonO(v * n)O(1)MediumcomplexAGAIN (not start)
766Toeplitz MatrixPythonO(m * n)O(1)Easybasic,matrix,googleAGAIN* (2)
769Max Chunks To Make SortedPython,JavaO(n)O(1)Mediumgood trick, prefix sum, stack, array, googleAGAIN*** (1)
792Number of Matching SubsequencesPython,JavaO(n + w)O(1)Mediumbasic, hash map, googleAGAIN**** (2)
794Valid Tic-Tac-Toe StatePythonO(1)O(1)MediumcomplexAGAIN
795Number of Subarrays with Bounded MaximumPythonO(n)O(1)MediumAGAIN (not start*)
807Max Increase to Keep City SkylinePythonO(n^2)O(n)MediumAGAIN*
821Shortest Distance to a CharacterPythonO(n)O(1)Easybasic,trickAGAIN**
830Positions of Large GroupsPythonO(n)O(1)EasybasicAGAIN*
832Flipping an ImagePythonO(n^2)O(1)EasyAGAIN*
835Image OverlapPythonO(n^4)O(n^2)MediumAGAIN (not start)
840Magic Squares In GridPythonO(m * n)O(1)EasycomplexAGAIN (not start)
842Split Array into Fibonacci SequencePythonO(n^3)O(n)Mediumcheck# 306 Addictive Number,basic,dfs,fibonacciAGAIN* (not start)
845Longest Mountain in ArrayPythonO(n)O(1)Mediumbasic,trickAGAIN* (not start)
849Maximize Distance to Closest PersonPython,JavaO(n)O(1)Mediumbasic, 2 pointers, LC 855, googleAGAIN********* (2)
860Lemonade ChangePythonO(n)O(1)EasyamazonOK* (2)
0868Transpose MatrixPythonO(r * c)O(1)EasybasicOK*
885Spiral Matrix IIIPythonO(max(m, n)^2)O(1)MediumbasicAGAIN* (not start)
888Fair Candy SwapPythonO(m + n)O(m + n)Easybasic,trickOK*
896Monotonic ArrayPythonO(n)O(1)Easyall,array ,fbOK
905Sort Array By ParityPythonO(n)O(1)Easysort by lambdaOK
909Snakes and LaddersPythonO(n^2)O(n^2)Mediumarray, matrix, dfs,complex,amazonAGAIN***** (3)
915Partition Array into Disjoint IntervalsPythonO(n)O(n)Mediumbasic,trickAGAIN* (not start)
918Maximum Sum Circular SubarrayPython,JavaO(n)O(1)Mediumcheck# 053 Maximum Subarray,basic,trickAGAIN** (2)
921Minimum Add to Make Parentheses ValidPython,JavaO(n)O(1)Mediumbasic,trickAGAIN**
922Sort Array By Parity IIPythonO(n)O(1)EasybasicAGAIN*
9233Sum With MultiplicityPythonO(n^2)O(n)MediumAGAIN (not start)
932Beautiful ArrayPython,JavaO(n)O(n)Mediumbasic,trick, googleAGAIN** (not start) (1)
941Valid Mountain ArrayPythonO(n)O(1)Easybasic,good basicAGAIN*
945Minimum Increment to Make Array UniquePythonO(nlogn)O(n)Mediumtrick,goodAGAIN**
947Most Stones Removed with Same Row or ColumnPython,JavaO(n)O(n)MediumUnion Find , dfs, trick,googleAGAIN** (1) (not start)
949Largest Time for Given DigitsPythonO(1)O(1)EasyOK*
950Reveal Cards In Increasing OrderPython,JavaO(n)O(n)Mediumqueue, 2 pointers, googleAGAIN (not start) (2)
954Array of Doubled PairsPythonO(n + klogk)O(k)Mediumcounter,dict,trickAGAIN**
961N-Repeated Element in Size 2N ArrayPythonO(n)O(1)EasyOK
989Add to Array-Form of IntegerPythonO(n)O(1)Easyadd xxx to sum, fbAGAIN (not start)
004Median of Two Sorted ArraysPython,JavaO(n)O(1)Hardarray, heapq, binary search, amazonAGAIN* (1)
10Regular Expression MatchingPython,JavaO(n)O(1)Hardrecursion, dp,fbAGAIN (not start)
056Merge IntervalsPython,JavaO(n)O(1)MediumCurated Top 75,good trick,057 Insert Interval,twitter,M$,UBER,google,amazon,fbOK********* (6) (but AGAIN)
759Employee Free TimePythonO(n)O(1)HardLC 56 and LC 986, heap, merger intervals, scanning line,amazon, fb, google, uber, airbnbAGAIN********** (2) (not start)
1007Minimum Domino Rotations For Equal RowJavaO(n)O(1)Mediumgoogle, array, dpAGAIN (1)
1014Best Sightseeing PairPythonMediumdp, array, good basic, SpotifyAGAIN (not start)
1027Longest Arithmetic SubsequencePython,JavaMediumdp, hash table, trick, google, amazonAGAIN*** (not start)
1031Maximum Sum of Two Non-Overlapping SubarraysJavaMediumprefix sum, slide window,googleAGAIN** (1)
1041Robot Bounded In CirclePythonMediumarray, math,amazonAGAIN** (2)
1094Car PoolingJavaMediumrange addition, presum, LC 370AGAIN****** (3) (MUST)
1109 Corporate Flight BookingsPython,JavaMediumLC 370, difference array, good basic,amazon, googleAGAIN********* (MUST) (3)
1248Count Number of Nice SubarraysPythonMediumLC 828, hash map, Prefix sum, dict, windown, good basic, deque, array,amazonAGAIN************** (3) (MUST)
1275Find Winner on a Tic Tac Toe GamePythonEasyamazonAGAIN (not start)
1564Put Boxes Into the Warehouse IJavaMediumgoogleAGAIN (not start)
1567Maximum Length of Subarray With Positive ProductPythonMediumgood trick, array, dp, 2 pointers, amazonAGAIN**** (1) (not start)
1914Cyclically Rotating a GridPythonMediumarray, brute force, dequeueamazonAGAIN (not start)
3195Find the Minimum Area to Cover All Ones IJavaMediumarray, LC weeklyAGAIN (1)

Set

#TitleSolutionTimeSpaceDifficultyNoteStatus
2357Make Array Zero by Subtracting Equal AmountsJavaO(n^2)O(1)MediumsetAgain (1)
1316Distinct Echo SubstringsJavaO(n^2)O(1)HardsetAgain (not start)

Slide Window

#TitleSolutionTimeSpaceDifficultyNoteStatus
1004Max Consecutive Ones IIIJavaO(n^2)O(1)Mediumslide windowAgain (1)
1838Frequency of the Most Frequent ElementJavaO(n^2)O(1)Mediumslide window, binary searchAGAIN******** (1)(good)

Hash Table

#TitleSolutionTimeSpaceDifficultyStatusNote
001Two SumPython,Java,ScalaO(n)O(n)Easygood basic,hash table,apple,amazon,UBER,grab,fbOK*** (6) (but again)
003Longest Substring Without Repeating CharactersPython,JavaO(n)O(1)MediumCurated Top 75, 2 pointers, optimized (SLIDING WINDOW + DICT),good trick,hashMap, MUST,apple,amazon,fbAGAIN**************** (12) (but AGAIN)
036Valid SudokuPython,JavaO(9^2)O(9)Mediumarray, hashset,UBER,apple,amazonOK**** (3) (again)
049Group AnagramsPython,Scala,JavaO(n * glogg)O(n)MediumCurated Top 75,good basic, dict,trick,dict + sort,UBER,amazon,fbOK ********** (6)
170Two Sum III - Data structure designPythonO(n)O(n)Easy🔒,trick,good basic,linkedin,fbOK*** (4)
187Repeated DNA SequencesPython,JavaO(n)O(n)Mediumbasic,trick,set,linkedin, googleAGAIN**
202Happy NumberPython,JavaO(k)O(k)Easytwitter,airbnb,UBERAGAIN** (4)
204Count PrimesPythonO(n)O(n)Mediumgood trick, cache, dict, set,M$,amazonAGAIN******** (5)
205Isomorphic StringsPython,JavaO(n)O(1)Easybasic,trick,bloombergAGAIN**
217Contains DuplicatePython,JavaO(n)O(n)EasyCurated Top 75,yahoo,airbnbOK
219Contains Duplicate IIPython,JavaO(n)O(n)Easybasic,trick,hash tableAGAIN*
244Shortest Word Distance IIPythonctor:O(n), lookup:O(a + b)O(n)Medium🔒AGAIN (not start*)
246Strobogrammatic NumberPython,JavaO(n)O(1)Easy🔒,google,fbOK* (5)
249Group Shifted StringsPython,JavaO(nlogn)O(n)MediumLC 49, 🔒, hashmap, char,apple,UBER,googleOK *****(6) (but again)
266Palindrome PermutationPythonO(n)O(1)Easy🔒OK
288Unique Word AbbreviationPythonctor:O(n), lookup:O(1)O(k)Medium🔒, ?, googleAGAIN (2)(not start)
290Word PatternPythonO(n)O(c)Easybasic, chcek# 205 Isomorphic Strings,good basic,for ptn, word in zip(pattern, words),dropbox ,UBERAGAIN* (3)
299Bulls and CowsPythonO(n)O(1)Easytrick,map(operator.eq, a, b),amazon,airbnb,googleAGAIN* (3)
314Binary Tree Vertical Order TraversalPythonO(n)O(n)Medium🔒,BFS,DFS,hash table,tree,trick,google,amazon,fb, m$OK**** (6)
325Maximum Size Subarray Sum Equals kPython,JavaO(n)O(n)Mediumprefix sum, 🔒,hashmap,good trick,dict,fbAGAIN***************** (8) (MUST)
356Line ReflectionPython,JavaO(n)O(n)Medium🔒, Hash, Two Pointers,math,googleAGAIN (not start)
359Logger Rate LimiterPython,JavaO(1), amortizedO(k)Easy🔒, googleOK
387First Unique Character in a StringPythonO(n)O(n)Easyamazon,apple,fbOK
388Longest Absolute File PathPythonO(n)O(d)Mediumstack, hash table, good trick, file system,googleAGAIN******* (3)
409Longest PalindromePythonO(n)O(1)EasyOK*
424Longest Repeating Character ReplacementPython,JavaO(n)O(1)MediumCurated Top 75, hash map,silding window,two pointers,good trick, LC blind patternAGAIN************* (9) (MUST)
438Find All Anagrams in a StringPython,JavaO(n)O(1)Mediumtrick,AGAIN,sliding window,acc Counter,amazon,fb, apple, google, uber, yahooAGAIN************** (11)(must)
447Number of BoomerangsPythonO(n^2)O(n)Easytrick,googleAGAIN (3) (not start)
4544Sum IIPythonO(n^2)O(n^2)Mediumcheck LC 018 4SUM,trick,basic,amazonAGAIN**
463Island PerimeterPython,JavaO(n)O(k)Mediumbasic,hash table,google,fb, amazonAGAIN** (2)
470Implement Rand10() Using Rand7()PythonO(1)O(1)Mediumtrick,googleAGAIN** (3)
473Matchsticks to SquarePython,JavaO(n * s * 2^n)O(n * (2^n + s))Mediumgood trick, backtrackAGAIN****** (2)
523Continuous Subarray SumPython,JavaO(n)O(k)Mediumsub array sum, check# 560 Subarray Sum Equals K,good trick,substring,hash table,AGAIN,M$,fb,appleAGAIN*************** (10) (MUST)
525Contiguous ArrayPython,JavaO(n)O(n)Mediumsub-array sum,good basic,array,hashmap,cache,AGAIN,fb, amazonAGAIN*************** (11) (MUST)
532K-diff Pairs in an ArrayPythonO(n)O(n)Mediumhash table,basic,collections.Counter(),a-b =k -> a = k + b,amazonAGAIN********** (6)
554Brick WallPython,JavaO(n)O(m)Mediumtrick,hash map,bloomberg,fb, grabAGAIN******** (6)
560Subarray Sum Equals KPython,JavaO(n)O(n)Mediumprefix sum,must check,check# 523 Continuous Subarray Sum, LC 1268,basic,substring,good trick,google,fbAGAIN************** (7) (MUST)
561Array Partition IPythonO(r)O(r)EasyOK
575Distribute CandiesPythonO(n)O(n)EasyOK
594Longest Harmonious SubsequencePythonO(n)O(n)Easybasic,good trickOK* (3)
599Minimum Index Sum of Two ListsPythonO((m + n) * l)O(m * l)EasyyelpOK*
609Find Duplicate File in SystemPythonO(n * l)O(n * l)Mediumcollections.defaultdict(list),dropboxOK*
657Robot Return to OriginPythonEasyamazonOK (2)
748Shortest Completing WordPythonO(n)O(1)Easycollections.Counter,hash table,googleAGAIN* (3)
760Find Anagram MappingsPythonO(n)O(n)Easybasic,collections.defaultdictOK
771Jewels and StonesPythonO(m + n)O(n)EasyamazonOK (2)
811Subdomain Visit CountPythonO(n)O(n)Easyindeed,bloombergAGAIN (not start)
822Card Flipping GamePythonO(n)O(n)Mediumgood basicAGAIN* (3)
825Friends Of Appropriate AgesPythonO(a^2 + n)O(a)Mediumgood basic,counter,AGAIN,fbAGAIN***** (5)
869Reordered Power of 2PythonO(1)O(1)Mediumtrick,basic,bit manipulation,bitAGAIN*
873Length of Longest Fibonacci SubsequencePythonO(n^2)O(n)Mediumtrick,DP,Fibonacci,setAGAIN**
957Prison Cells After N DaysPythonO(1)O(1)Mediumtrick,DP,modAGAIN (not start)
966Vowel SpellcheckerPythonO(n)O(w)Mediumtrick,dict,setAGAIN (not start)
974Subarray Sums Divisible by KPythonO(n)O(k)Mediumvariant of# 560 Subarray Sum Equals K ,trick,basicAGAIN** (3) (not start)
992Subarrays with K Different IntegersPythonO(n)O(k)Hard2 pointers, hashmap, sliding window, amazonAGAIN (not start)
1010Pairs of Songs With Total Durations Divisible by 60PythonMediumgood basicm dict, array,amazonAGAIN********* (4) (MUST)
1099Two Sum Less Than KPythonMediumdict, sort,amazonAGAIN* (1) (not start)
1121Divide Array Into Increasing SequencesJavaHarddict, googleAgain (not start)
1131Rank Transform of an ArrayPythonEasydict, array,amazonOK* (1)
1170Compare Strings by Frequency of the Smallest CharacterJavaMediumhashmap, binary search,googleAGAIN*** (1)s
1257Smallest Common RegionJavaMediumhashmap, good trick, lowest common ancestor (LCA)AGAIN (not start)
1296Divide Array in Sets of K Consecutive NumbersPythonMediumLC 846, dict,googleAGAIN (not start)
1923Longest Common SubpathPythonO(n)O(h)Hardhash, bit,amazonAGAIN (not start)
2506Count Pairs Of Similar StringsJavaO(n)O(h)Easyhashmap, LC weeklyAGAIN (1)

Linked list

#TitleSolutionTimeSpaceDifficultyNoteStatus
002Add Two NumbersPython,JavaO(n)O(1)MediumCurated Top 75, check# 445 Add Two Numbers II,basic,linked list,airbnb,amazon,fbOK**** (6) (but again)
021Merge Two Sorted ListsPython,JavaO(n)O(1)EasyCurated Top 75,UBER,amazon,apple,fbOK******** (6) (but again)
023Merge k sorted listsPython,JavaO(n)O(h)HardCurated Top 75, linked list, check#21 Merge Two Sorted Lists,amazonOK**** (2) (but again !!!
024Swap Nodes in PairsPython,JavaO(n)O(1)MediumGOOD basic, LC 100 like,UBER,amazon,fbAGAIN**************** (8) (MUST)
025Reverse Nodes in k-GroupPython,JavaO(n)O(1)Hardgood trick, reverse linkedlist, reverse K linkedlist, amazon, google, fb, m$AGAIN********** (4)
061Rotate ListPython,JavaO(n)O(1)MediumbasicAGAIN (2)
082Remove Duplicates from Sorted List IIPython,JavaO(n)O(1)Mediumgood basic,check# 083 Remove Duplicates from Sorted ListAGAIN (3) *****
083Remove Duplicates from Sorted ListPython,JavaO(n)O(1)EasybasicOK*
92Reverse Linked List IIPython,JavaO(n)O(1)Medium# 206 Reverse Linked List,good trick, fb, apple, google, amazon, m$AGAIN*************** (9) (MUST)
138Copy List with Random PointerPython,JavaO(n)O(1)Mediumtrick, recursive, linked list,hash table,UBER,M$,amazon,fbAGAIN******* (7)
160Intersection of Two Linked ListsPython,JavaO(m + n)O(1)Easybasic, hash table, 2 pointers, linkedlist,airbnb,amazon,fbOK******* (7) (again!)
203Remove Linked List ElementsPython ,JavaO(n)O(1)Easylinked list basic,amazonOK** (3)
206Reverse Linked ListPython,JavaO(n)O(1)EasyCurated Top 75,good basic,amazon,fbOK*********** (9) (MUST again)
234Palindrome Linked ListPython,JavaO(n)O(1)Easylinked list,amazon,fbOK (4)
237Delete Node in a Linked ListPython,JavaO(1)O(1)EasyLintCode, appleOK * (1) (but again)
328Odd Even Linked ListPythonO(n)O(1)MediumbasicOK** (2)
369Plus One Linked ListPython,JavaO(n)O(1)Medium🔒, linkedlist,basic, googleAGAIN****** (3)
445Add Two Numbers IIPythonO(m + n)O(m + n)Mediumtrick, linked list, string,good basic,amazonAGAIN*** (3)
725Split Linked List in PartsPythonO(n + k)O(1)Mediummod, split linked list, linked list, good trick,amazonAGAIN************ (6) (again)
817Linked List ComponentsPython,JavaO(m + n)O(m)Mediumset, array, linkedlist, googleAGAIN** (1)
430Flatten a Multilevel Doubly Linked ListPython,JavaMediumgood trick,doubly linked list,dfs,iterative, stack,fb, googleAGAIN******** (6)
707Design Linked ListPython,JavaO(n)O(h)Mediumlinked list basic OPAGAIN (1)
708Insert into a Cyclic Sorted ListPython,JavaO(n)O(h)MediumAGAIN,cyclic linked list,good trick,google,amazon,fb , googleAGAIN******** (4)
1836Remove Duplicates From an Unsorted Linked ListJavaO(n)O(h)Mediumlinked listAGAIN (not start)

Stack

#TitleSolutionTimeSpaceDifficultyNoteStatus
020Valid ParenthesesPython,JavaO(n)O(n)EasyCurated Top 75,good basic,fb,amazonOK** (6)
032Longest Valid ParenthesesPythonO(n)O(n)Hardbrute force, dp, stackm deque, LC top 100 likes,amazon, fb, m$AGAIN***** (1) (not start)
071Simplify PathPython,JavaO(n)O(n)Mediumbasic,stack,amazon,fbOK** (5)
085Maximal RectanglePythonO(n)O(n)Hardtop-100-like, brute force, stack, dp, LC 084, google, amazon, appleAGAIN (not start)
101Symmetric TreePython,JavaO(n)O(h)Easygood basic,bfs,dfs,linkedin,M$,amazon,fb, googleAGAIN********** (6)
150Evaluate Reverse Polish NotationPython,JavaO(n)O(n)Mediumstack, good trick,amazonAGAIN********* (5)
155Min StackPython,JavaO(n)O(1)Mediumbasic, stack, data structure,amazonOK*********** (5)
173Binary Search Tree IteratorPython,JavaO(1)O(h)Mediumgood basic, stack,tree, stack, M$,linkedin,google,amazon,fb, googleOK***** (5)
224Basic CalculatorPythonO(n)O(n)Hardbasic,trick,stack, LC 227, amazonAGAIN******* (3)
227Basic Calculator IIPythonO(n)O(n)Mediumdelay op, LC 224,good trick,stack,airbnb ,fb, amazonAGAIN************** (6) (MUST)
232Implement Queue using StacksPython,JavaO(1), amortizedO(n)Easystack, stack-queue, EPI, LintCode,amazonAGAIN*** (3)(MUST)
255Verify Preorder Sequence in Binary Search TreePythonO(n)O(1)Medium🔒AGAIN (not start)
321Create Maximum NumberJavaO(n)O(1)Harddp, greedy, mono-stack, googleAGAIN (not start) (2)
331Verify Preorder Serialization of a Binary TreePythonO(n)O(1)MediumAGAIN (not start)
341Flatten Nested List IteratorPythonO(n)O(h)MediumLC 284, 🔒 Iterator, stack, generator,good basic,amazon,fb***AGAIN********* (6)
385Mini ParserPythonO(n)O(h)MediumAGAIN
394Decode StringPython,JavaO(n)O(h)Mediumstack, good basic!!!!, pre num string, LC 224, LC 227,amazon,googleAGAIN************** (8) (MUST)
439Ternary Expression ParserPythonO(n)O(1)Medium🔒AGAIN (not start)
456132 PatternPythonO(n)O(n)MediumAGAIN (not start)
496Next Greater Element IPython,JavaO(n)O(n)Easygood basic, stack,monotonic stack, LC 739, LC 503, LC 406OK************ (6) (but again)
503Next Greater Element IIPython,JavaO(n)O(n)Mediumgood basic, stack, LC 739, LC 503, LC 406, next_big_val_idxAGAIN************* (7)
636Exclusive Time of FunctionsPythonO(n)O(n)Mediumtrick,AGAIN,stack,UBER,fbAGAIN********** (4)
682Baseball GamePython,JavaO(n)O(n)Easygood basic, stack,amazonOK* (3)
735Asteroid CollisionPythonO(n)O(n)Mediumgood basic, stack, m$, GS, fb,amazonAGAIN************** (5)
739Daily TemperaturesPython,JavaO(n)O(n)MediumLC 739, LC 503, LC 406, LC 496, LC 42, Monotonic stack, good trick,amazonAGAIN******************* (12) (MUST)
772Basic Calculator IIIJavaO(n)O(n)Mediumcheck LC 224, 227, stackAGAIN (not start)
853Car FleetPython,JavaO(nlogn)O(n)Mediumstack, good basic, google, amzAGAIN********* (5)
856Score of ParenthesesPythonO(n)O(1)MediumAGAIN (not start)
872Leaf-Similar TreesPython,JavaO(n)O(h)EasyAGAIN*
895Maximum Frequency StackPython,JavaO(n)O(h)Hardgood basic, heap, design, stack, amazon, apple, linkedin, m$, twitterAGAIN********** (1) (not start)
901Online Stock SpanPython,JavaO(n)O(n) MediumAGAIN (not start)
946Validate Stack SequencesPythonO(n)O(n)MediumAGAIN
1047Remove All Adjacent Duplicates in StringPython,JavaO(n)O(n)easygood basic, fb, amazon, googleAGAIN************ (3) (MUST)
1209Remove All Adjacent Duplicates in String IIPythonO(n)O(n)Mediumgood basic, stack, two pointers, greedy, fb, amamzon, apple, spotifyAGAIN************ (3) (MUST)
1703Minimum Adjacent Swaps for K Consecutive OnesPythonO(n)O(n)Hardheap, sliding window, amazonAGAIN (not start)
1896Minimum Cost to Change the Final Value of ExpressionPythonO(n)O(n)Hardcomplex, stack, dp, dp+stack, dfs,amazonAGAIN (not start)
2104Sum of Subarray RangesPython,JavaO(n)O(1)MediumLC 907, monotonic stack, brute force, 2 pointers, dp,amazonAGAIN******* (4)

Tree

#TitleSolutionTimeSpaceDifficultyNoteStatus
94Binary Tree Inorder TraversalPythonO(n)O(1)Mediumtree, iteration, recursion,good basic,Morris Traversal,M$,fbAGAIN********* (4) (MUST)
124Binary Tree Maximum Path SumPython,JavaO(n)O(1)HardCurated Top 75, google, amazon, fb, m$, twitterAGAIN*********** (6) (MUST)
144Binary Tree Preorder TraversalPython,JavaO(n)O(1)MediumMorris TraversalOK
145Binary Tree Postorder TraversalJavaO(n)O(1)MediumMorris TraversalOK
208Implement Trie (Prefix Tree)Python,JavaO(n)O(1)MediumCurated Top 75, dict tree, LC 211, trie,amazon,fbAGAIN************** (7) (MUST)
211Design Add and Search Words Data StructurePython,JavaO(min(n, h))O(min(n, h))MediumCurated Top 75,Trie, recursive, node, hashMap, do# 208 first,amazon ,fbAGAIN*********** (8) (MUST)
226Invert Binary TreePython,JavaO(n)O(h),O(w)EasyCurated Top 75, good basicOK******* (4) (but again)
250Count Univalue SubtreesPython,JavaO(n)O(h),O(w)MediumLC 572not start
297Serialize and Deserialize Binary TreePython,JavaO(n)O(h),O(w)HardCurated Top 75, BFS, DFS, Binary Treeagain******* (4)
307Range Sum Query - MutablePython,Javactor:O(n), update:O(logn), query:O(logn)O(n)MediumLintCode, DFS, Segment Tree, BIT, check#303 Range Sum Query - Immutable , googleAGAIN* (2)(not start)
427Construct Quad TreeJavaO(n)O(h),O(w)Mediumtree, Quadtreesagain (not start)
536Construct Binary Tree from StringPython,JavaO(n)O(h)Medium🔒, tree, recursive,trick, check# 606 Construct String from Binary Tree,amazonAGAIN******** (5)
538Convert BST to Greater TreePython,JavaO(n)O(h)Mediumgood basic, dfs, bfs, tree,amazonOK********* (6) (but again!)
543Diameter of Binary TreePython,JavaO(n)O(h)Easydfs, tree,trick,google,amazon,fbAGAIN*********** (7)(MUST)
545Boundary of Binary TreePythonO(n)O(h)Mediumrecursive, dfs, tree boundary, tree,🔒,good trick,amazonAGAIN********* (6)
548Split Array with Equal SumPythonO(n^2)O(n)Medium🔒,good trick,arrayAGAIN*** (2)
563Binary Tree TiltPythonO(n)O(n)EasyAGAIN
572Subtree of Another TreePython,JavaO(m * n)O(h)EasyCurated Top 75, LC 100, recursive call recursion func, good basic, dfs, bfs,amazon,fbOK************* (10) (but again)
606Construct String from Binary TreePythonO(n)O(h)Easygood basic, tree, dfs, LC # 536,amazonOK******** (7) (again!)
617Merge Two Binary TreesPython,JavaO(n)O(h)Easytree, dfs, bfs,good basic,amazonOK************* (7) (but again)
623Add One Row to TreePythonO(n)O(h)Mediumgood basic,dfs,bfsAGAIN** (2)
637Average of Levels in Binary TreePython,JavaO(n)O(h)Easybfs,dfs,good basic,fbOK*** (4)
652Find Duplicate SubtreesPython,JavaO(n)O(n)MediumAGAIN, good basic,path, dfs, Hashmap,amazonAGAIN************** (7)
653Two Sum IV - Input is a BSTPython,JavaO(n)O(h)EasyTwo Pointers,2 sum,bfs,dfs,amazon,fbOK******* (4)
654Maximum Binary TreePython,JavaO(n)O(n)MediumLintCode, Descending Stack,good basicAGAIN* (2)
655Print Binary TreePythonO(n)O(h)MediumAGAIN* (2) (not start)
662Maximum Width of Binary TreePythonO(n)O(h)Mediumwidth of tree, bfs, dfs,trick,amazonAGAIN********* (5)
663Equal Tree PartitionPythonO(n)O(n)Medium# LC 508, AGAIN, 🔒 , Hash, tree, dfs ,trick,good trick,amazonOK******** (8)
677Map Sum PairsPythonO(n)O(t)MediumTrie,trick,hardAGAIN* (2) (not start)
684Redundant ConnectionPython,JavaO(n)O(n)Mediumdfs, graph, Union Find,basicAGAIN****** (3) (not start)
687Longest Univalue PathPython,JavaO(n)O(h)Mediumbasic, dfs, tree,trick,googleAGAIN**** (4)
814Binary Tree PruningPythonO(n)O(h)MediumDFS,basicAGAIN* (2)
863All Nodes Distance K in Binary TreePython,JavaO(n)O(n)MediumLC 752, tree-> graph, move upward, tree, DFS + BFS,trick,hard,amazonAGAIN************ (4)(MUST)
866Smallest Subtree with all the Deepest NodesPythonO(n)O(h)MediumDFS,trick,basicAGAIN** (2)
889Construct Binary Tree from Preorder and Postorder TraversalPython,JavaO(n)O(h)MediumDFS,stack,trick, tree, recursive, googleAGAIN** (2) (not start*)
897Increasing Order Search TreePythonO(n)O(h)EasyDFS,good basic,inorderAGAIN** (2)
919Complete Binary Tree InserterPythonctor:O(n)
insert:O(1)
get_root:O(1)
O(n)MediumbstAGAIN** (2)
938Range Sum of BSTPythonO(n)O(h)MediumDFS, check# 108 Convert Sorted Array to Binary Search TreeAGAIN* (2)
951Flip Equivalent Binary TreesPython,JavaO(n)O(h)Mediumrecursion, tree, DFS, googleAGAIN***s (3)
958Check Completeness of a Binary TreePythonO(n)O(w)MediumBFS,DFS,basicAGAIN** (2)
965Univalued Binary TreePythonO(n)O(h)EasyDFS,BFS,good basicAGAIN** (2)
971Flip Binary Tree To Match Preorder TraversalPythonO(n)O(h)MediumDFS,trickAGAIN** (2) (not start)
979Distribute Coins in Binary TreePythonO(n)O(h)MediumDFS,trickAGAIN*** (2)
508 Most Frequent Subtree SumPythonMediumtree, dfs, bfs, good basic,amazonOK*********** (4) (but again MUST)
683K Empty SlotsPythonHardBST, tree, bucket,googlenot start
701Insert into a Binary Search TreePython,JavaMediumgood basic, BST, tree, BFS, DFSOK***** (3)
1032Stream of CharactersJavaHardtrie, googleAGAIN (not start)
1157Online Majority Element In SubarrayJavaHardtree, googleAGAIN (not start)
1325Delete Leaves With a Given ValueJavaMediumdfs, tree, good basic, LC 450AGAIN*** (2)
1339Maximum Product of Splitted Binary TreePythonMediumdfs, tree, amazonAGAIN*** (1) (not start)
1372Longest ZigZag Path in a Binary TreePythonMediumdfs, bfs, post order, good trick, tree, amazonAGAIN*** (1) (not start)
1448Count Good Nodes in Binary TreePython,JavaMediummax in path, dfs, bfs, good trick, tree, needcode, google, amz, m$AGAIN************* (3) (MUST)
1522Diameter of N-Ary TreeJavaMediumLC 543, treeAGAIN (not start)
1666Change the Root of a Binary TreeJavaMediumLC 1448, good trick, googleAGAIN (1) (not start)
1740Find Distance in a Binary TreeJavaMediumLCA + NODE DIST + DFS, DFS, LCAAGAIN (1)****
2415Reverse Odd Levels of Binary TreeJavaMediumLC 226, dfs, bfs, treeAGAIN (not start)
2509Cycle Length Queries in a TreeJavaHardLC weekly, treeAGAIN (not start)
2707Extra Characters in a StringJavaMediumdp, TrieAGAIN (not start)

Heap

#TitleSolutionTimeSpaceDifficultyNoteStatus
264Ugly Number IIPythonO(n)O(1)Mediumgood trick, LC 263, LC 313, Heap, LintCode , DP, M$AGAIN*********** (4) (MUST)
313Super Ugly NumberPythonO(n * k)O(n + k)MediumBST, HeapAGAIN (not start*)
373Find K Pairs with Smallest SumsPython,JavaO(k * log(min(n, m, k)))O(min(n, m, k))Mediumgoogle, heapAGAIN (not start)
378Kth Smallest Element in a Sorted MatrixPythonO(k * log(min(n, m, k)))O(min(n, m, k))MediumLintCodeAGAIN (not start)
502IPOJavaO(k * log(min(n, m, k)))O(min(n, m, k))HardPQAGAIN (not start)
846Hand of StraightsPython,JavaO(nlogn)O(n)MediumLC 1296, good basic, PQ, Treemap, hashmap, googleOK******** (3)
855Exam RoomPython,Javaseat:O(logn)
leave:O(logn)
O(n)MediumtreeSet, BST, Hash,trick, LC 849, googleAGAIN* (3) (not start)
295Find Median from Data StreamPython,JavaHardCurated Top 75, priority queue, trick ,heap, stream,amazonAGAIN****** (6)
703Kth Largest Element in a StreamPython,JavaEasyheap, priority queue,amazonAGAIN******** (5)
1046Last Stone WeightPython,JavaEasyHeap, Priority QueueOK
1130Minimum Cost Tree From Leaf ValuesPythonMediumLC 1167,heapnot start
1167Minimum Cost to Connect SticksPythonMediumLC 1130, good basic,heap,amazonAGAIN***** (3)
1353Maximum Number of Events That Can Be AttendedPython,JavaMediumLC 252, 253, good trick, meeting room, heap, PRIORITY QUEUE, fb, twitter,amazonAGAIN********* (3) MUST
1405Longest Happy StringJavaMediumPQAGAIN (not start)
1481Least Number of Unique Integers after K RemovalsPythonMediumgood trick, greedy, Counter, dict, heap,amazonAGAIN******** (3)
1834Single-Threaded CPUJavaMediumgood trick, heap, pqAGAIN***** (1)

Bit Manipulation

#TitleSolutionTimeSpaceDifficultyNoteStatus
136Single NumberPythonO(n)O(1)Easyairbnb,amazon,fbOK
137Single Number IIPythonO(n)O(1)MediumOK
190Reverse BitsPython,JavaO(1)O(1)EasyCurated Top 75, bit,appleAGAIN*** (2)
191Number of 1 BitsPython,JavaO(1)O(1)EasyCurated Top 75, appleOK*
201Bitwise AND of Numbers RangePythonO(1)O(1)MediumAGAIN (not start)
231Power of TwoPythonO(1)O(1)Easygood basic, Bit Manipulation ,amazonOK*** (3)
260Single Number IIIPythonO(n)O(1)Mediumxor,^=,^AGAIN*
268Missing NumberPython,JavaO(n)O(1)MediumCurated Top 75,xor,amazon,fbOK* (2)
318Maximum Product of Word LengthsPythonO(n) ~O(n^2)O(n)MediumBit Manipulation, Counting Sort, PruningAGAIN (not start)
342Power of FourPythonO(1)O(1)Easypower of numOK*
371Sum of Two IntegersPython,JavaO(1)O(1)MediumCurated Top 75,good basic,fbAGAIN********* (5) (bit op not start)
389Find the DifferencePythonO(n)O(1)EasyamazonOK (2)
393UTF-8 ValidationPythonO(n)O(1)Mediumutf-8 encoding,google,fbAGAIN**** (not start*) (5)
401Binary WatchPythonO(1)O(1)EasyOK*
421Maximum XOR of Two Numbers in an ArrayPythonO(n)O(n)MediumAGAIN (not start)
461Hamming DistancePythonO(1)O(1)EasyfbOK* (2)
462Minimum Moves to Equal Array Elements IIPythonO(n) on averageO(1)MediumAGAIN*
477Total Hamming DistancePythonO(n)O(1)Mediumbit manipulation,fbAGAIN****** (not start*) (4)
645Set MismatchPythonO(n)O(1)EasyamazonOK* (3)
693Binary Number with Alternating BitsPythonO(1)O(1)EasytrickAGAIN*
762Prime Number of Set Bits in Binary RepresentationPythonO(1)O(1)Easybasic,Bit_Manipulation,prime number,amazonOK* (4)
868Binary GapPythonO(1)O(1)Easytrick,linear scanAGAIN*
898Bitwise ORs of SubarraysPythonO(n)O(1)MediumAGAIN (not start)
1573Number of Ways to Split a StringPythonO(n)O(1)Mediumamazon, binaryAGAIN** (not start)
1915Number of Wonderful SubstringsPythonO(n)O(1)Mediumbit mask, bit, prefix sum, dp,amazonAGAIN*** (2) (not start)
3688Bitwise OR of Even Numbers in an ArrayJavaO(n)O(1)Mediumbit maskOK

String

#TitleSolutionTimeSpaceDifficultyStatus, NoteStatus
005Longest Palindromic SubstringPython,JavaO(n)O(n)MediumCurated Top 75, LC 647, good trick, 2 pointer, recursive,Manacher's Algorithm, LC 100 like,DP,UBER,amazon,fbAGAIN************** (8)(MUST)
006ZigZag ConversionPythonO(n)O(1)MediumAGAIN (not start)
008String to Integer (atoi)PythonO(n)O(1)Mediumstring op,regular expression,UBER,amazon,fbAGAIN***** (5)
014Longest Common PrefixPython,JavaO(n * k)O(1)Easygood basic, LCP, str, binary search, scanAGAIN !!!! (4)
028Implement strStr()Python,JavaO(n + k)O(k)EasyKMP Algorithm,fbOK (3)
038Count and SayPython,JavaO(n * 2^n)O(2^n)Mediumrecursion,iteration, basic,fbAGAIN*********** (5)
43Multiply StringsPython,JavaO(m * n)O(m + n)Mediumtwitter,fbAGAIN*** (3)
058Length of Last WordPythonO(n)O(1)EasyOK
067Add BinaryPython,JavaO(n)O(1)Easybit op,good basic,fb,amazonOK***** (7) (but again)
076Minimum Window SubstringPython,JavaHardslide window, good pattern,Curated Top 75AGAIN*********** (3)
125Valid PalindromePython,JavaO(n)O(1)EasyCurated Top 75, LC 680,amazon,fbOK
151Reverse Words in a StringPythonO(n)O(1)Mediumamazon,fbOK (2)
161One Edit DistancePythonO(m + n)O(1)Medium🔒, trick, recursion, string, ,fbAGAIN ******** (6)(AGAIN)
165Compare Version NumbersPythonO(n)O(1)Mediumgood basic, string,amazon,appleOK** (5)
186Reverse Words in a String IIPythonO(n)O(1)MediumLC 151, LC 557, 🔒,M$,UBER,amazonAGAIN* (3)
242Valid AnagramPython,JavaO(n)O(1)EasyCurated Top 75, LintCode,amazon,fbOK
271Encode and Decode StringsPython,JavaO(n)O(1)MediumCurated Top 75, decode-encode,string op, check# 394 Decode String ,🔒,googleAGAIN*** (3)
306Addictive NumberPythonO(n^3)O(n)MediumAGAIN (not start*)
340Longest Substring with At Most K Distinct CharactersPython,JavaO(n^3)O(n)Hardstring, sliding window,googlenot start
383Ransom NotePythonO(n)O(1)EasyEPI, appleOK*
405Convert a Number to HexadecimalPythonO(n)O(1)Easybasicsdecimal -> HexadecimalAGAIN
408Valid Word AbbreviationPythonO(n)O(1)Easy🔒AGAIN (not start)
415Add StringsPython,JavaO(n)O(1)Easygood basic,add xxx to sum,Airbnb,google,fbOK****** (4)
434Number of Segments in a StringPythonO(n)O(1)EasyOK
443String CompressionPythonO(n)O(1)Easyshoptify,basicsAGAIN**
459Repeated Substring PatternPythonO(n)O(n)Easygood basic, string,KMP Algorithm,amazonOK*** (6)
468Validate IP AddressPythonO(1)O(1)Mediumip basic,string,twitter,fb,amazonAGAIN****** (5)
482License Key FormattingPython,JavaO(n)O(1)Easystring, basic,googleOK** (4) (again)
520Detect CapitalPythonO(l)O(1)EasyOK
521Longest Uncommon Subsequence IPythonO(min(a, b))O(1)EasyOK*
522Longest Uncommon Subsequence IIPythonO(l * n^2)O(1)MediumSortAGAIN (not start)
524Longest Word in Dictionary through DeletingPython,JavaO((d * l) * logd)O(1)Medium Sort, dict, brute force,googleAGAIN (not start)
539Minimum Time DifferencePythonO(nlogn)O(n)Mediumbasic,map & zip trickAGAIN**
541Reverse String IIPythonO(n)O(1)EasyAGAIN*
551Student Attendance Record IPythonO(n)O(1)EasyOK
556Next Greater Element IIIPythonO(1)O(1)MediumAGAIN (not start)
557Reverse Words in a String IIIPythonO(n)O(1)EasyOK
616Add Bold Tag in StringPythonO(n * d * l)O(n)Medium🔒,googleAGAIN (not start)
647Palindromic SubstringsPython,JavaO(n)O(n)MediumCurated Top 75, LC 005, greedy, DP, expand from center, 2 pointers,good basic,Manacher's Algorithm,Linkedin,amazon,fbOK********* (9) (MUST)
648Replace WordsPythonO(n)O(t)MediumTrie,good basicOK*
657Judge Route CirclePythonO(n)O(1)EasyOK
678Valid Parenthesis StringPython,JavaO(n)O(1)MediumAGAIN**
680Valid Palindrome IIPython,JavaO(n)O(1)EasyLC 125, two pointers,good basic, Palindrome,string,fbAGAIN******** (3)
681Next Closest TimePythonO(1)O(1)Mediumsubset of set,<=,strptime,google,fbOK*** (5)
686Repeated String MatchPython,JavaO(n + m)O(1)Mediumbrute force, math, string,Rabin-Karp Algorithm,googleAGAIN**** (3)
696Count Binary SubstringsPythonO(n)O(1)Easygood trick, linear scan, group sub-string,amazonAGAIN******* (3) (MUST)
720Longest Word in DictionaryPythonO(n)O(t)EasyTrieAGAIN (not start)
722Remove CommentsPython,JavaO(n)O(k)Mediumstring, googleAGAIN (1)
734Sentence SimilarityPython,JavaO(n + p)O(p)Easygood basic, graph,hash table,collections.defaultdict(set) ,googleOK***** (5)
751IP to CIDRPythonO(n)O(1)MediumipAGAIN (not start*)
758Bold Words in StringPythonO(n * l)O(t)Easy🔒, variant ofAdd Bold Tag in StringAGAIN (not start)
791Custom Sort StringPythonO(n)O(1)Mediumgood basic, sort, counter,amazon,fbAGAIN************ (7) (MUST)
796Rotate StringPythonO(n)O(1)Easygood basic,KMP Algorithm,Rabin-Karp Algorithm,amazonOK**** (2)(but again)
804Unique Morse Code WordsPythonO(n)O(n)EasyOK*
806Number of Lines To Write StringPythonO(n)O(1)EasyOK*
809Expressive WordsPython,JavaO(n + s)O(l + s)Mediumgoogle, stringAGAIN (1)
816Ambiguous CoordinatesPythonO(n^4)O(n)MediumAGAIN (not start*)
819Most Common WordPythonO(m + n)O(m + n)Easyregular expression,amazonOK** (2)
820Short Encoding of WordsPythonO(n)O(t)MediumTrieAGAIN (not start)
824Goat LatinPythonO(n + w^2)O(l)Easystring basic,fbOK
828Count Unique Characters of All Substrings of a Given StringPythonO(n + w^2)O(l)HardLC 1248, dp,string,amazonAGAIN*** (2)
831Masking Personal InformationPythonO(1)O(1)Mediumregular expressionOK*
833Find And Replace in StringPython,JavaO(n + m)O(n)Mediumgood basic, string op, hashmap, googleAGAIN****** (3)
848Shifting LettersPythonO(n)O(1)Mediumremainder,basicAGAIN**
859Buddy StringsPythonO(n)O(1)EasyAGAIN*
880Decoded String at IndexPythonO(n)O(1)MediumtrickAGAIN (not start**)
884Uncommon Words from Two SentencesPythonO(m + n)O(m + n)Easycollections Counter,trickOK*
890Find and Replace PatternPython,JavaO(n * l)O(1)Mediumhashmap, pattern, LC 49AGAIN *** (3)
893Groups of Special-Equivalent StringsPythonO(n * l)O(n)EasyAGAIN*
916Word SubsetsPythonO(m + n)O(1)MediumAGAIN (not start)
917Reverse Only LettersPythonO(n)O(1)Easybasic,stack,pointerOK*
925Long Pressed NamePythonO(n)O(1)Easytwo pointer,basic,trickAGAIN*
929Unique Email AddressesPythonO(n * l)O(n * l)EasyOK
939Minimum Area RectanglePython,JavaO(n^1.5) on averageO(n)Mediumhashmap, brute force, googleAGAIN !!! (2)
942DI String MatchPythonO(n)O(1)EasyAGAIN (not start)
944Delete Columns to Make SortedPythonO(n * l)O(1)MediumAGAIN (not start)
953Verifying an Alien DictionaryPython,JavaO(n * l)O(1)EasyAGAIN (not start)
955Delete Columns to Make Sorted IIPythonO(n * l)O(n)MediumAGAIN (not start)
1119Remove Vowels from a StringPythonO(n * l)O(n)EasyamazonOK

Queue

#TitleSolutionTimeSpaceDifficultyTagNote
281Zigzag IteratorPythonO(n)O(k)Mediumgood basic, queue, 🔒,google,fbAGAIN******* (5)
346Moving Average from Data StreamPython,JavaO(1)O(w)Easy🔒, queue,google,fbOK** (6)
933Number of Recent CallsPythonO(1) on averageO(w)EasyAGAIN**
622Design Circular QueuePython,JavaMediumgood basic, array, linked list, design,circular queue,amazon,fb, apple, airbnb, m$AGAIN************ (3) (MUST)
239Sliding Window MaximumPython,JavaHardsliding window, heap, deque, queue,good trick,amazon,googleAGAIN************ (6)

Math

#TitleSolutionTimeSpaceDifficultyNoteStatus
007Reverse IntegerPythonO(1)O(1)Medium0x7FFFFFFF, amazon, appleOK* (3)
009Palindrome NumberPythonO(1)O(1)EasyamazonOK
012Integer to RomanPythonO(n)O(1)Mediummath basic,twitter,fb, amazon, mathAGAIN****** (4)
013Roman to IntegerPython,JavaO(n)O(1)Easygood trick, map,UBER,amazon,fbAGAIN***** (6)
029Divide Two IntegersPythonO(1)O(1)Mediumbinary search,trick,fbAGAIN***** (3)
050Pow(x, n)Python,JavaO(1)O(1)Mediumgood trick,amazon,fb, recursionAGAIN****** (4)
060Permutation SequencePythonO(n^2)O(n)MediumCantor Ordering,trick ,amazonAGAIN*** (2)
089Gray CodePythonO(2^n)O(1)Mediumbit op, math,amazonAGAIN ********** (6)
166Fraction to Recurring DecimalPythonO(logn)O(1)MediumAGAIN (not start)
168Excel Sheet Column TitlePython,JavaO(logn)O(1)Easytrick, residual, math, AGAIN,fbAGAIN****** (5)
171Excel Sheet Column NumberPythonO(n)O(1)EasyAGAIN (not start)
172Factorial Trailing ZeroesPythonO(1)O(1)Easybasic,iteration,recursionAGAIN* (2)
223Rectangle AreaPythonO(1)O(1)EasyAGAIN
258Add DigitsPythonO(1)O(1)EasyAGAIN
263Ugly NumberPythonO(1)O(1)EasymathOK* (2)
273 Integer to English WordsPythonO(1)O(1)Hardamazon, passednot start
292Nim GamePythonO(1)O(1)EasyLintCodeOK*
319Bulb SwitcherPythonO(1)O(1)MediumAGAIN
326Power of ThreePythonO(1)O(1)EasyOK
338Counting BitsPython,JavaO(n)O(n)MediumCurated Top 75OK
343Integer BreakPython,JavaO(logn)O(1)Mediumtrick,DPAGAIN* (2)
365Water and Jug ProblemPythonO(logn)O(1)MediumBézout's identityAGAIN (not start)
372Super PowPythonO(n)O(1)MediumAGAIN
382Linked List Random NodePythonO(n)O(1)MediumReservoir SamplingAGAIN (not start)
386Lexicographical NumbersPythonO(n)O(1)MediumAGAIN (not start)
390Elimination GamePythonO(logn)O(1)MediumAGAIN (not start)
398Random Pick IndexPythonO(n)O(1)MediumReservoir Sampling ,fbOK* (4)
400Nth DigitPythonO(logn)O(1)EasyAGAIN
413Arithmetic SlicesPythonO(n)O(1)Mediumsliding window,amazonOK*** (1) (but again)
423Reconstruct Original Digits from EnglishPythonO(n)O(1)MediumGCJ2016 - Round 1BAGAIN (not start)
441Arranging CoinsPythonO(nlogn)O(1)EasyBinary SearchOK
453Minimum Moves to Equal Array ElementsPythonO(n)O(1)EasyAGAIN
458Poor PigsPythonO(n)O(1)EasyAGAIN
469Convex PolygonPythonO(n)O(1)Medium🔒AGAIN (not start)
470Implement Rand10() Using Rand7()PythonO(1)O(1)MediumAGAIN (not start)
478Generate Random Point in a CirclePythonO(1)O(1)MediumAGAIN (not start)
497Random Point in Non-overlapping RectanglesPythonctor:O(n)
pick:O(logn)
O(n)MediumAGAIN (not start)
504Base 7Pythonbinary, math, good basicO(n)EasyAGAIN******** (1)
519Random Flip MatrixPythonctor:O(1)
pick:O(1) reset:O(n)
O(n)MediumAGAIN (not start)
528Random Pick with WeightPython,JavaO(logn)O(n)Mediumgood basic, binary search, prefix sum, googleAGAIN**** (1)
537Complex Number MultiplicationPythonO(1)O(1)Mediummath,amazonOK (3)
553Optimal DivisionPythonO(n)O(1)Mediumstring, math,amazonOK* (4)
573Squirrel SimulationPythonO(n)O(1)Medium🔒AGAIN (not start)
592Fraction Addition and SubtractionPythonO(nlogx)O(n)MediumAGAIN
593Valid SquarePython,JavaO(1)O(1)Mediumgoogle, mathAGAIN
598Range Addition IIPython,JavaO(p)O(1)EasyAGAIN
625Minimum FactorizationPythonO(loga)O(1)Medium🔒OK*
628Maximum Product of Three NumbersPythonO(n)O(1)EasyamazonOK (2)
633Sum of Square NumbersPythonO(sqrt(c) * logc)O(1)EasyOK*
634Find the Derangement of An ArrayPythonO(n)O(1)Medium🔒AGAIN (not start)
640Solve the EquationPythonO(n)O(n)Mediummath, regular expression,amazonAGAIN*** (3)
6514 Keys KeyboardPythonO(1)O(1)Medium🔒, Math, DPAGAIN (not start)
672Bulb Switcher IIPythonO(1)O(1)MediumAGAIN (not start)
728Self Dividing NumbersPythonO(n)O(1)MediumAGAIN
754Reach a NumberPythonO(logn)O(1)MediumOK*
775Global and Local InversionsPythonO(n)O(1)Mediumtrick, math, string,amazonAGAIN** (not start) (3)
779K-th Symbol in GrammarPythonO(1)O(1)Mediummath, brute force, binary, recursion, FB, amazonAGAIN*** (1)
781Rabbits in ForestPythonO(n)O(n)MediumAGAIN (not start)
789Escape The GhostsPythonO(n)O(1)MediumAGAIN
800Similar RGB ColorPythonO(1)O(1)Easy🔒AGAIN (not start)
812Largest Triangle AreaPythonO(n^3)O(1)EasyAGAIN (not start)
829Consecutive Numbers SumPythonO(sqrt(n))O(1)MediumAGAIN
836Rectangle OverlapPythonO(1)O(1)Easysimilar as 223. Rectangle Area,amazonAGAIN (2)
858Mirror ReflectionPythonO(1)O(1)MediumAGAIN (not start)
866Prime PalindromePythonO(n^(1/2) * (logn + n^(1/2)))O(logn)MediumAGAIN***
867Transpose MatrixJavaO(n^(1/2) * (logn + n^(1/2)))O(logn)MediumAGAIN*
883Projection Area of 3D ShapesPythonO(n^2)O(1)EasyAGAIN
891Sum of Subsequence WidthsPythonO(n^2)O(1)HardamazonAGAIN (not start)
907Sum of Subarray MinimumsPythonO(n)O(n)Mediumtrick, LC 084, LC 2104, Ascending Stack,amazonAGAIN**** (1)
908Smallest Range IPythonO(n)O(1)EasyOK* (2)
910Smallest Range IIPythonO(nlogn)O(1)MediumAGAIN (not start)
914X of a Kind in a Deck of CardsPythonO(n * (logn)^2)O(n)EasyAGAIN (not start)
963Minimum Area Rectangle IIPythonO(n^2) ~O(n^3)O(n^2)MediumAGAIN (not start)
970Powerful IntegersPythonO((logn)^2)O(r)EasybasicAGAIN* (2)
517Super Washing MachinesPythonHardamazonAGAIN (not start)
1071 Greatest Common Divisor of StringsJavaO(n^2) ~O(n^3)O(n^2)EasyAGAIN (not start)
1342Number of Steps to Reduce a Number to ZeroPythoneasygra*ok
1492The kth Factor of nPythonMediumamazonAGAIN (not start)
1979Find Greatest Common Divisor of ArrayPythonEasyGCDnot start
2013Detect SquaresJavaMediummathnot start
2507Smallest Value After Replacing With Sum of Prime FactorsJavaMediummath, LC weeklyagain (1)
2807Insert Greatest Common Divisors in Linked ListJavaMediummathOK
3190Find Minimum Operations to Make All Elements Divisible by ThreeJavaEasyLC weekly, mathOK
3194Minimum Average of Smallest and Largest ElementsJavaEasyLC weekly, mathOK

Sort

#TitleSolutionTimeSpaceDifficultyNoteStatus
075Sort ColorsPython,JavaO(n)O(1)Mediumsorting, Tri Partition,two pointers,M$,fbOK** (4)
088Merge Sorted ArrayPython,JavaO(n)O(1)Easygood basic, merge, sort,two pointers,M$,amazon,fbAGAIN************* (8) (MUST)
128Longest Consecutive SequencePython,JavaMediumCurated Top 75, 2 pointers, sort, sliding window,amazonAGAIN*********** (4) (MUST)
147Insertion Sort ListPythonO(n^2)O(1)MediumtrickAGAIN* (2)
148Sort ListPythonO(nlogn)O(logn)Mediumbasic, check# 21 Merge Two Sorted ListsAGAIN** (2)
179Largest NumberPythonO(nlogn)O(1)Mediumgood basic, sort with lambda,amazonAGAIN************ (3)
252Meeting RoomsPython,JavaO(nlogn)O(n)EasyCurated Top 75, sort, 🔒,UBER,amazon,fbOK*** (4) (but again)
253Meeting Rooms IIPython,JavaO(nlogn)O(n)MediumCurated Top 75, 🔒, sort, priority queue (min-heap),scanning line,trick,booking.com,good,UBER,amazon,google,fbAGAIN************ (5) (MUST)
274H-IndexPythonO(n)O(n)MediumCounting Sort,good trick,fbAGAIN***** (3)
280Wiggle SortPythonO(n)O(1)Medium🔒,google,fbOK*** (3)
324Wiggle Sort IIPythonO(n) on averageO(1)Mediumvariant ofSort Colors , Tri Partition,googleAGAIN** (2)
347Top K Frequent ElementsPython,JavaO(n)O(n)MediumCurated Top 75 , HashMap, Heap, Sort,Yelp,amazon,fb, GOOD basicAGAIN******** (4)
406Queue Reconstruction by HeightPython,JavaO(n * sqrt(n))O(n)Mediumbasic,trick,sort by key,insert,google, next_big_valAGAIN********* (5)
451Sort Characters By FrequencyPython,JavaO(n)O(n)Mediumcollections.Counter(s).most_common,sorted(count_dict.items() with lambda,good basic,amazonOK* (4)
692Top K Frequent WordsPython,JavaO(n + klogk) on averageO(n)Mediumgood basic,Quick Select, Heap, Bucket Sort,heapq,yelp,UBER,amazon,fbOK***** (5)
937Reorder Data in Log FilesPythonO(nlogn * l)O(l)Mediumgood basic, sort,string,amazonOK**** (3)(again!!!)
969Pancake SortingPythonO(n^2)O(l)Mediumfb, sortingAGAIN********** (4)
973K Closest Points to OriginPython,JavaO(n) on averageO(1)Mediumgood trick, sort with func, PQ, Heap,amazonOK***** (3)(but again)
976Largest Perimeter TrianglePython,JavaO(nlogn)O(1)EasyOK* (2)
912Sort an ArrayPython,JavaO(nlogn)O(1)Mediumsort, merge sort, quick sort, apple, amazon, m$AGAIN** (1)
1057Campus BikeJavaO(nlogn)O(1)Mediumsorting, googleAGAIN
1066Campus Bike IIJavaO(nlogn)O(1)Mediumsorting, googleAGAIN
1152Analyze User Website Visit PatternPythonO(nlogn)O(1)Mediumitertools.combinations, sort, brute force, set,amazonAGAIN***** (2) (not start)
2021Brightest Position on StreetPythonO(nlogn)O(1)MediumLC 253 meeting room II, priority queue (min-heap), scanning line, trick,amazonAGAIN*********** (3) (MUST)
2284Sender With Largest Word CountJavaO(1)MediumLC 347, map sortingOK
2402Meeting Rooms IIIJavaO(nlogn)O(n)HardAGAIN (not start)

Two Pointers

#TitleSolutionTimeSpaceDifficultyNoteStatus
019Remove Nth Node From End of ListPython,JavaO(n)O(1)MediumCurated Top 75, good basic, MUST,linked list,two pointers,fbAGAIN********** (4) (MUST)
042Trapping Rain WaterPython,JavaHardstack, prefix-suffix array, brute force, two pointer,amazon,appleAGAIN******** (3)
086Partition ListPython,JavaO(n)O(1)MediumOK*
141Linked List CyclePython,JavaO(n)O(1)EasyCurated Top 75,basic,amazon,fb, linked list, 2 pointers, check #142OK** (5)
142Linked List Cycle IIPython,JavaO(n)O(1)Mediumlinked list, 2 pointers, check #141AGAIN****** (4) (again!)
143Reorder ListPython,JavaO(n)O(1)MediumCurated Top 75, LC 021, 206, 876,good trick,inverse linkedlist,merge linkedlist ,fb, amazonAGAIN********** (5) (MUST)
167Two Sum II - Input array is sortedPython,JavaO(n)O(1)Mediumtwo pointer, dict, binary search,good basic,amazonOK* (6)
2593Sum SmallerPythonO(n^2)O(1)Medium🔒, LintCode,good trick,google,fb, check#015 3 Sum, check#001 two sumAGAIN******** (4)
283Move ZeroesPython,JavaO(n)O(1)Easybasic,trick, ,two pointers,Shopee,fbAGAIN** (5)
344Reverse StringPythonO(n)O(1)EasyOK
345Reverse Vowels of a StringPython,JavaO(n)O(1)EasygoogleOK** (1)
349Intersection of Two ArraysPythonO(m + n)O(min(m, n))EasyEPI, Hash, Binary Search,fbOK
350Intersection of Two Arrays IIPythonO(m + n)O(1)EasyEPI, Hash, Binary Search,good basic,fbOK** (3)
360Sort Transformed ArrayPythonO(n)O(1)Mediumtrick,🔒,google ,fbAGAIN*** (3)
457Circular Array LoopPythonO(n)O(1)MediumAGAIN (not start)
567Permutation in StringPython,JavaO(n)O(1)MediumCollections.counter,sliding window, sorting, hashmap,substring,good basic,M$,fbAGAIN********* (8)
611Valid Triangle NumberPythonO(n^2)O(1)MediumAGAIN (not start)
777Swap Adjacent in LR StringPythonO(n)O(1)MediumAGAIN (not start)
826Most Profit Assigning WorkPythonO(mlogm + nlogn)O(n)Mediumtrick,good basic,zip+sortedOK*
844Backspace String ComparePython,JavaO(m + n)O(1)Easygood basic,stack,google,fbOK* (4)
876Middle of the Linked ListPython,JavaO(n)O(1)Easybasic, amazon, apple, google, 2 pointers, linkedlistOK* (2)
904Fruit Into BasketsPython,JavaO(n)O(1)Medium2 pointers, googleAGAIN (not start)
930Binary Subarrays With SumPythonO(n)O(1)MediumtrickAGAIN* (2) (not start)
977Squares of a Sorted ArrayPythonO(n)O(1)EasyOK
986Interval List IntersectionsJavaO(n)O(1)Medium2 pointer, scanning line, good basic, googleAGAIN********* (1) (MUST)
1055Shortest Way to Form StringPython,JavaO(n)O(h)Medium2 pointer,googleagain
1151Minimum Swaps to Group All 1's TogetherPythonO(n)O(1)Mediumgood basic, 2 pointers, Deque (Double-ended Queue),amazonAGAIN***** (not start )
1768Merge Strings AlternatelyJavaO(n)O(h)Easytree,recursion,googleOK
1963Minimum Number of Swaps to Make the String BalancedPythonO(n)O(h)Mediumgood basic, greedy, stack, 2 pointers, amazon, fb, m$AGAIN******** (2)
3191Minimum Operations to Make Binary Array Elements Equal to One IJavaO(n)O(h)Medium2 pointersAgain* (2)
3192Minimum Operations to Make Binary Array Elements Equal to One IIJavaO(n)O(h)Medium2 pointersAgain* (2)

Recursion

#TitleSolutionTimeSpaceDifficultyNoteStatus
10Regular Expression MatchingPythonO(n)O(h)Hardrecursive, dp,amazonAGAIN (not start)
095Unique Binary Search Trees IIPythonO(4^n / n^(3/2)O(4^n / n^(3/2)Mediumrecursion, BST, amazon, google, appleAGAIN!!! (1)(good trick)
098Validate Binary Search TreePython,JavaO(n)O(1)MediumCurated Top 75, recursion, bfs, dfs,BST,M$,amazon,fbAGAIN****************** (11)
100Same TreePython,JavaO(n)O(h)EasyCurated Top 75, recursion, dfs, bfs,good basic,amazonOK****** (5) (but again)
104Maximum Depth of Binary TreePython,JavaO(n)O(h)EasyCurated Top 75, DFS, BFS, good basic,amazon, LC 111OK******** (5) (but again)
105Construct Binary Tree from Preorder and Inorder TraversalPython,JavaO(n)O(n)MediumCurated Top 75,trick, check # 106,BST,M$,fbAGAIN********* (9)
106Construct Binary Tree from Inorder and Postorder TraversalPython,JavaO(n)O(n)Mediumtrick,check # 105,BST,M$,fbAGAIN******* (6)
108Convert Sorted Array to Binary Search TreePython,JavaO(n)O(logn)Easygood basic, BST, build tree, DFSAGAIN********* (1) (must)
109Convert Sorted List to Binary Search TreePythonO(n)O(logn)Mediumlist,BST,good concept,fbAGAIN*** (3)
110Balanced Binary TreePython,JavaO(n)O(h)Easygood trick,LC 104,dfs,bfs,amazon ,fb, google, top-down, bottom-up recursionAGAIN************** (8)(MUST)
111Minimum Depth of Binary TreePython,JavaO(n)O(h)Easygood basic,dfs,BST,amazon,fb, LC 104AGAIN******** (5)
114Flatten Binary Tree to Linked ListPython,JavaO(n)O(h)MediumBST,dfs,M$,fbAGAIN**** (4)
116Populating Next Right Pointers in Each NodePython,JavaO(n)O(1)Mediumgood basic, bfs, dfs, tree, recursion ,AGAIN,fb, amazonAGAIN************ (6)
117Populating Next Right Pointers in Each Node IIPython,JavaO(n)O(h)Mediumgood basic, prev node,Populating Next Right Pointers in Each Node I, bfs, linked list,amazon,fb, googleAGAIN************* (4)
129Sum Root to Leaf NumbersPython,JavaO(n)O(h)Mediumpath sum,trick,BST,dfs,fbAGAIN*** (4)
156Binary Tree Upside DownPythonO(n)O(1)Medium🔒AGAIN (not start)
241Different Ways to Add ParenthesesPython,JavaO(n * 4^n / n^(3/2))O(n * 4^n / n^(3/2))Mediumcomplex, dp, recursion, Memoization, googleAGAIN (not start)
298Binary Tree Longest Consecutive SequencePython,JavaO(n)O(h)MediumLC 437, good basic, bfs, dfs, tree, 🔒,googleAGAIN ********* (4) (must)
333Largest BST SubtreePythonO(n)O(h)Medium🔒AGAIN (not start)
337House Robber IIIPython,JavaO(n)O(h)Mediumgood trick, dp + dfs, amazon, googleAGAIN****** (2)(MUST)
395Longest Substring with At Least K Repeating CharactersPython,JavaO(n)O(1)Mediumslide window,DIVIDE AND CONQUER,good trick,fb, googleAGAIN************ (4)
404Sum of Left LeavesPython,JavaO(n)O(h)Easy, tree, bfs, dfs, amazonAGAIN**** (4)
437Path Sum IIIPython,JavaO(n)O(h)MediumLC 298, path sum,good trick,UBER,AMAZON,fbAGAIN******** (4) (must)
501Find Mode in Binary Search TreeJavaO(n)O(h)Mediumdfs, bfs, LC 98OK (1)
544Output Contest MatchesPythonO(n)O(n)MediumAGAIN
549Binary Tree Longest Consecutive Sequence IIPythonO(n)O(h)Medium🔒AGAIN (not start)
669Trim a Binary Search TreePythonO(n)O(h)Mediumgood basic, BST, dfs, recursion,amazonAGAIN******* (4)
671Second Minimum Node In a Binary TreePythonO(n)O(h)Easydfs,treeOK* (2)
753Cracking the SafesJavaO(n)O(h)Harddfs,recursion,googleAGAIN (not start)
1145Binary Tree Coloring GameJavaO(n)O(h)Mediumtree,recursion,googleAGAIN (not start)

Binary Search

#TitleSolutionTimeSpaceDifficultyTag, NoteStatus
33Search in Rotated Sorted ArrayPython,JavaMediumCurated Top 75,binary search, LC 153,good basic ,check# 81 Search in Rotated Sorted Array II, binary search, rotation array,UBER,amazon,fbAGAIN************ (6) (MUST)
034Find First and Last Position of Element in Sorted ArrayPython,JavaO(n)O(1)Mediumbinary search, LC top 100 like,amazon,fb, google, apple, uberAGAIN************** (4) (MUST)
034Search for a RangePythonO(logn)O(1)MediumAGAIN*
035Search Insert PositionPython,JavaO(logn)O(1)MediumAGAIN
069Sqrt(x)PythonO(logn)O(1)Mediummath, binary search,amazon,fbOK* (4)
074Search a 2D MatrixPython,JavaO(logm + logn)O(1)Mediumbinary search in 2D array, flatten matrix,amazonOK**** (BUT AGAIN)(3)
081Search in Rotated Sorted Array IIPython,JavaO(logn)O(1)Mediumbinary search,check# 33 Search in Rotated Sorted Array first,array,fb, amazon, linkedinOK***** (6)
153Find Minimum in Rotated Sorted ArrayPython,JavaO(logn)O(1)MediumCurated Top 75, LC 33, binary search, ascending array, good basic,amazonAGAIN************* (8)(MUST)
154Find Minimum in Rotated Sorted Array IIJavaO(logn)O(1)MediumLC 153, binary searchAGAIN (not start)
162Find Peak ElementPython,JavaO(logn)O(1)Mediumgood trick, recursive, iterative binary search,M$,google,fbAGAIN********** (6)
222Count Complete Tree NodesPython,JavaO((logn)^2)O(1)Easygoogle, treeOK (again)
275H-Index IIPythonO(logn)O(1)Mediumsimilar as# 274 H-Index, Binary Search,fbAGAIN**** (3)
278First Bad VersionPython,JavaO(logn)O(1)Easygood basic,LintCode, binary search,fbOK*** (5) (MUST)
300Longest Increasing SubsequencePython,JavaO(nlogn)O(n)MediumCurated Top 75, array, binary search,DP good basic, LintCode, DP,amazon,fbAGAIN********** (10)
315Count of Smaller Numbers After SelfPython,JavaO(logn)O(1)Hardbinary search, BST, BIT,googleagain*
367Valid Perfect SquarePython,JavaO(logn)O(1)Easygood basic, similar as# 69 Sqrt(x)OK* (3)
374Guess Number Higher or LowerPython,JavaO(logn)O(1)EasyOK*
410Split Array Largest SumPython,JavaO(logn)O(1)HardgoogleAGAIN (not start)
436Find Right IntervalPythonO(nlogn)O(n)MediumAGAIN (not start)
475HeatersPythonO((m + n) * logn)O(1)EasyAGAIN (not start)
540Single Element in a Sorted ArrayPython,JavaO(logn)O(1)MediumOK*
564Find the Closest PalindromeJavaO(logn)O(1)HardgoogleAGAIN(not start)
658Find K Closest ElementsPython,JavaO(logn + k)O(1)Mediumgood trick, PQ,two pointers,binary search,amazon,fb, googleAGAIN ****************** (7) (MUST)
744Find Smallest Letter Greater Than TargetPythonO(logn)O(1)EasyOK*
852Peak Index in a Mountain ArrayPython,JavaO(logn)O(1)MediumLC 162 Find Peak Element,amazon, googleOK* (2)
875Koko Eating BananasPython,JavaO(nlogr)O(1)Mediumbinary search, left boundary, good basicAGAIN******* (4)(MUST)
894All Possible Full Binary TreesPythonO(n * 4^n / n^(3/2))O(n * 4^n / n^(3/2))MediumAGAIN (not start)
911Online ElectionPythonctor:O(n)
query :O(logn)
O(n)MediumAGAIN (not start)
981Time Based Key-Value StorePython,JavaO(n)Mediumbinary search, dict, treeMap, floorKey, sort, apple, M$, amz, googleAGAIN****** (2)
1011Capacity To Ship Packages Within D DaysPython,JavaMediumgood trick, binary search, amazon, apple, fb, m$, googleAGAIN****** (3)
1060Missing Element in Sorted ArrayJavaMediumbinary search, brute force, good trick, googleAGAIN**** (2)
1095Find in Mountain ArrayJavaHardAGAIN (not start)
1889 Minimum Space Wasted From PackagingPythonHardheap, prefix sum, binary search, amazonAGAIN (not start)
2009Minimum Number of Operations to Make Array ContinuousPythonHardbinary search, sliding window, dequeue, bisect.bisect_right, amazonAGAIN (not start)

Binary Search Tree

#TitleSolutionTimeSpaceDifficultyTag,NoteStatus
220Contains Duplicate IIIPythonO(nlogk)O(k)MediumAGAIN (not start)
230Kth Smallest Element in a BSTPython,JavaO(max(h, k))O(min(h, k))MediumCurated Top 75, good basic BST basic, DFS, BFS, STACK, BST,amazonOK********* (4)
235Lowest Common Ancestor of a Binary Search TreePython,JavaO(h)O(1)MediumCurated Top 75, BST, recursion, iteration, good basic,LCA, check# 236 Lowest Common Ancestor of a Binary Tree,amazon,fbOK**************** (but again)(10)
270Closest Binary Search Tree ValuePythonO(h)O(1)Easygood basic ,🔒,M$, BST,google,fbOK***** (5)
285Inorder Successor in BSTPythonO(h)O(1)MediumBST, dfs, good basic, 🔒,amazon,fbOK** (4)
449Serialize and Deserialize BSTPythonO(n)O(h)MediumLC 297, dfs, bfs, good trick,serizlize deserizlize, tree,amazon,fbAGAIN************* (9) (MUST)
450Delete Node in a BSTPython,JavaO(h)O(h)Mediumgood trick, BST, tree, dfs, LC 1325AGAIN***************** (9) (MUST !!!)
510Inorder Successor in BST IIJavaO(h)O(h)MediumBST, parentAGAIN** (1) (not start)
530Minimum Absolute Difference in BSTPython,JavaO(n)O(h)EasyLC 783AGAIN*
700Search in a Binary Search TreePython,JavaO(n)O(h)EasyBST, good basic, recursion, iteration amazonAGAIN*** (1)
776Split BSTPython,JavaO(n)O(h)Medium🔒, BST, DFS, trick, AGAIN ,amazon, googleAGAIN********* (6)
783Minimum Distance Between BST NodesPythonO(n)O(h)EasyLC 530OK*
426Convert Binary Search Tree to Sorted Doubly Linked ListPythonMediumrecursion, tree,linked list,good basicUBER,lyft,amazon,google,fbAGAIN******* (5) (not start)
968Binary Tree CamerasPythonO(n)Hardamazon, dfs, bst, dp, greedy, m$AGAIN (not start)
1022 Sum of Root To Leaf Binary NumbersPythonO(n)Easygood basic, LC 257, bst path, dfs, bfs,amazonAGAIN******** (1) (MUST)
1597Build Binary Expression Tree From Infix ExpressionPythonO(n)HardLC 224, recursive, iteration, stack,amazon, google, bstAGAIN*** (1)
1644Lowest Common Ancestor of a Binary Search Tree 2JavaO(h)O(1)MediumLC 235, 236, dfsAGAIN (1)
1650Lowest Common Ancestor of a Binary Search Tree 3JavaO(h)O(1)MediumLC 235, 236, dfsAGAIN (not start)

Breadth-First Search

#TitleSolutionTimeSpaceDifficultyTagStatus
102Binary Tree Level Order TraversalPython,JavaO(n)O(n)EasyCurated Top 75,GOOD basic,dfs,bfs,UBER,apple,amazon,fb, LC 199AGAIN******* (8) (must)
107Binary Tree Level Order Traversal IIPython,JavaO(n)O(n)Easysame as# 102 Binary Tree Level Order TraversalOK* (3)
103Binary Tree Zigzag Level Order TraversalPythonO(n)O(n)Mediumamazon,fbOK
126Word Ladder IIPython,JavaHardcomplex, trick, dfs, bfs, dfs+bfs, check# 127 Word Ladder,amazonAGAIN*** (3) (not start)
127Word LadderPython,JavaO(n * d)O(d)Hard/Mediumgood basic, check #126 Word Ladder II,bfs,UBER,amazon,M$,fbAGAIN************** (10)
130Surrounded RegionsPython,JavaO(m + n)Mediumbfs,dfs,union find,good basic,amazonAGAIN*********** (5)
133Clone GraphPython,JavaO(n)O(n)MediumCurated Top 75, good trick, LC 138,graph,dfs,bfs,UBER,google,amazon,fbAGAIN**************** (11) (MUST)
207Course SchedulePython,JavaO(|V| + |E|)O(|E|)MediumCurated Top 75, Topological Sort, LC 210,good trick,dfs,bfs ,amazon,fbAGAIN**************** (15) (MUST)
210Course Schedule IIPython,JavaO(|V| + |E|)O(|E|)MediumTopological Sort,LC 207, dfs ,amazon ,fbAGAIN********* (10) (again)
261Graph Valid TreePython,JavaO(|V| + |E|)O(|V| + |E|)MediumCurated Top 75, AGAIN, bfs, dfs, grpah, 🔒,graph,quick union,union find ,google,amazon,fbAGAIN************* (11)(MUST)
286Walls and GatesPython,JavaO(m * n)O(g)Medium🔒,dfs,bfs ,good basic,google,amazon,FBAGAIN******** (8)
310Minimum Height TreesPython,JavaO(n)O(n)Mediumcomplex,bfs,googleAGAIN (4)
433Minimum Genetic MutationPythonO(n * b)O(b)Mediumcheck# 127 Word Ladder,good basicAGAIN*** (3)
444Sequence ReconstructionPython,JavaO(n * s)O(n)Mediumgood trick,Topological Sort ,google,airbnbAGAIN******* (4) (not start)
490The MazePythonO(max(r, c) * w)O(w)Mediumbasic,bfs,dfs,amazon,fbAGAIN**** (5)
505The Maze IIPythonO(max(r, c) * wlogw)O(w)Mediumtrick,bfs,dfs,AGAIN,google,fbAGAIN********* (6)
54201 MatrixPython,JavaO(m * n)O(m * n)Mediummulti-source BFS, googleAGAIN*** (3)
666Path Sum IVPythonO(n)O(w)Medium🔒 Topological SortAGAIN* (3) (not start)
742Closest Leaf in a Binary TreePython,JavaO(n)O(n)MediumAGAIN, Graph, bfs+dfs, search,good trick,amazonAGAIN********** (6)
743Network Delay TimePython,JavaO(n)O(n)MediumDijlstra, shortest path in parallel,googleAGAIN **** (3)
752Open the LockPython,JavaO(k * n^k + d)O(k * n^k + d)MediumLC 863, googleAGAIN (not start)
787Cheapest Flights Within K StopsPython,JavaO(|E| * log|V|)O(|E|)MediumDijkstra's algorithm, dfs, bfs, graph, priority queue,amazon, apple, google, airbnbAGAIN****** (4)
815Bus RoutesPython,JavaO(|E| * log|V|)O(|E|)Hardshortest route, graph, bfs,amazon, googleAGAIN**** (3)
886Possible BipartitionPythonO(|V| + |E|)O(|V| + |E|)Mediumcheck# 785 Is Graph Bipartite?,graph,AGAIN,union find ,fbAGAIN********** (6)
934Shortest BridgePython,JavaO(n^2)O(n^2)MediumBFS, DFS,complex, dfs,bfs,googleAGAIN (1)
967Numbers With Same Consecutive DifferencesPythonO(2^n)O(2^n)Mediumgood trickAGAIN** (3)
675Cut Off Trees for Golf EventPython,JavaHardtree, BFS, complex,amazonAGAIN (not start)
864Shortest Path to Get All KeysPythonHardBFS,amazonAGAIN (not start)
1091Shortest Path in Binary MatrixJavaMediumBFS,googleAGAIN (not start)
994Rotting OrangesPython,JavaMediumBFS, dpamazonOK** (2)
1110Delete Nodes And Return ForestPython,JavaMediumBFS, recursivegooglenot start
1162As Far from Land as PossiblePythonMediumdfs, bfs, good basic,amazonAGAIN**** (3)
1197Minimum Knight MovesJavaMediumBFS,googleOK (1)
1730Shortest Path to Get FoodPythonMediumshortest path, bfs,amazonOK (2)
2115Find All Possible Recipes from Given SuppliesJavaMediumbfs, dfs, topological sort,googleOK (2)

Depth-First Search

#TitleSolutionTimeSpaceDifficultyTagStatus
112Path SumPython,Scala,JavaO(n)O(h)Easygood concept,amazon, dfs, recursionAGAIN** (2)
113Path Sum IIPython,JavaO(n)O(h)Mediumdfs, backtrack, good basic, LC112 Path Sum,good basic,amazon,fbAGAIN********* (7)
199Binary Tree Right Side ViewPython,JavaO(n)O(h)Mediumgood basic,dfs,bfs,apple,amazon,fb, LC 102OK*** (6)
200Number of IslandsPython,JavaO(m * n)O(m * n)MediumCurated Top 75,bfs,dfs,good basic,check# 694, 711 Number of Distinct Islands,apple,Goldman Sachs,google,amazon,fbOK****** (6)
236Lowest Common Ancestor of a Binary TreePython,JavaO(n)O(h)Mediumtrick,EPI,LCA, LC 1644, 235,apple,amazon,linkedin,fbAGAIN************* (9)
247Strobogrammatic Number IIPython,JavaO(n^2 * 5^(n/2))O(n)Medium🔒,check#246 Strobogrammatic Number,good trick,google,fbAGAIN******** (5)
257Binary Tree PathsPython,JavaO(n * h)O(h)Easygood basic,apple,google,amazon,fb, iterative, dfs, LC 112, 113AGAIN********* (MUST) (7)
332Reconstruct ItineraryPython,JavaO(t! / (n1! * n2! * ... nk!))O(t)MediumDFS,yelp,googleAGAIN* (3) (not start)
339Nested List Weight SumPythonO(n)O(h)Easy🔒,good basic,bfs,linkedin,fbAGAIN*** (3)
364Nested List Weight Sum IIPythonO(n)O(h)Medium🔒,linkedinAGAIN*
366Find Leaves of Binary TreePythonO(n)O(h)Medium🔒,linkedinAGAIN*
399Evaluate DivisionPython,JavaO(q * |V|!)O(e)Mediumgood trick,union find,dfs,good trick,union findgoogle,fbAGAIN*********** (8)
417Pacific Atlantic Water FlowPython,JavaO(m * n)O(m * n)MediumCurated Top 75, 2 direction dfs, dfs, matrix,m$,googleAGAIN** (3)
464Can I WinPythonO(n!)O(n)MediumDP,linkedinAGAIN* (not start)
491Increasing SubsequencesPythonMediumtrick,dfs,dfs good trick,dp,yahoo ,fbAGAIN***** (2)
515Find Largest Value in Each Tree RowPythonO(n)O(h)Mediumgood basic,linkedinAGAIN* (3)
529MinesweeperPython,JavaMediumdfs, bfs, good basic, dfs, bfs,amazon,googleAGAIN**** (5)
547Friend CirclesPythonO(n^2)O(n)Mediumgraph, Union Find,dfs, bfs,check# 733 Flood Fill,bloomberg ,fbAGAIN*** (3) (not start)
547Number of ProvincesPythonO(n^2)O(n)Mediumdfs, bfs, graph, union find, good basic, apple, amazonAGAIN************ (2) (MUST)
582Kill ProcessPythonO(n)O(n)Medium🔒, DFS, BFS,good basic ,bloomberg,amazonAGAIN***** (4)
638Shopping OffersPythonO(n * 2^n)O(n)MediumgoogleAGAIN (not start*)
690Employee ImportancePythonO(n)O(h)EasyDFS, BFS,good basic ,UBEROK** (3)
694Number of Distinct IslandsPythonO(m * n)O(m * n)Medium#200, #711 Number of Islands good pattern, dfs, 🔒, compare with# 200 Number of Islands,amazonAGAIN******** (5)
695Max Area of IslandPython,JavaO(m * n)O(m * n)Mediumdfs, primitives in java,amazon,microsoft,linkedin,basicAGAIN* (3)
711Number of Distinct Islands IIPython,JavaHardcomplex, dfs, check# 200, 694 Number of Distinct Islands,amazonOK*** (3)
721Accounts MergePython,JavaO(nlogn)O(n)Mediumdfs, Disjoint Set Union (DSU),Union Find,path compression,complex,fb, google, amazon, m$, apple, twitterAGAIN******* (4) (not start)
733Flood FillPythonO(m * n)O(m * n)Easyfb,amazon,good basicOK**** (5)
737Sentence Similarity IIPython,JavaO(m * n)O(m * n)Mediumdfs, union find, dis-joint,googleAGAIN**** (2)
756Pyramid Transition MatrixPythonO(a^b)O(a^b)MediumAGAIN (3) (not start)
785Is Graph Bipartite?PythonO(|V| + |E|)O(|V|)Mediumcheck #886 Possible Bipartition,AGAIN,graph,dfs,fb,amazonAGAIN*********** (6)
797All Paths From Source to TargetPythonO(p + r * n)O(n)Mediumgraph,dfs classics,good basicAGAIN** (3)
802Find Eventual Safe StatesPython,JavaO(|V| + |E|)O(|V|)MediumTopological Sort, dfs, bfd, graph, googleAGAIN (4) (not start)
841Keys and RoomsPythonO(n!)O(n)Mediumgoogle,bfs,dfs,good basicAGAIN*** (3)
851Loud and RichPythonO(q + r)O(q + r)Mediumamazon,defaultdict,good basicAGAIN*** (3)
1087Brace ExplansionJavaO(q + r)O(q + r)Mediumdfs, backtrack, good trick, googleAGAIN*** (1)
1192Critical Connections in a NetworkPythonO(q + r)O(q + r)HardTarjan's algorithm,dfs, graph, fb, amazonAGAIN** (1) (not start)
1644Lowest Common Ancestor of a Binary Tree IIJavaO(q + r)O(q + r)MediumLCA, LC 236, m$, fbAGAIN (not start)
1650Lowest Common Ancestor of a Binary Tree IIIPythonO(q + r)O(q + r)Mediumparent node, good trick, dfs, set, dict, LCA, LC 236, amazon, google, spotify m$, fbAGAIN******** (2) (MUST)
1676Lowest Common Ancestor of a Binary Tree IVPythonO(q + r)O(q + r)MediumLCA, LC 236, a m$AGAIN (not start)
3319K-th Largest Perfect Subtree Size in Binary TreeJavaO(q + r)O(q + r)MediumDFS, good trick, binary-tree, post orderAGAIN*** (2)

Backtracking

#TitleSolutionTimeSpaceDifficultyTag, NoteStatus
017Letter Combinations of a Phone NumberPython,JavaO(n * 4^n)O(n)Mediumdfs, backtrack,good trick,UBER,amazon,google,fbAGAIN************* (11) (MUST)
022Generate ParenthesesPython,JavaO(4^n / n^(3/2))O(n)MediumLC 20, good basic, stack, backtrac, Divide and Conquer,amazonOK**************** (5) (but again, MUST)
037Sudoku SolverPythonO(4^n / n^(3/2))O(n)Hardbacktrack, google, amazon, uberAGAIN(not start)
039Combination SumPython,JavaO(k * n^k)O(k)Mediumbacktrack,dfs,good basic,UBER,airbnb,amazon,fbOK********* (7) (but again)
040Combination Sum IIPython,JavaO(k * C(n, k))O(k)MediumLC 39, avoud duplicatedAGAIN******* (4) (MUST)
046PermutationsPython,JavaO(n * n!)O(n)Mediumbacktrack, LC #77, 78,good concept,M$,linkedin,amazon,fbOK*********** (4) (AGAIN, MUST)
047Permutations IIPython,JavaO(n * n!)O(n)MediumLC 46, avoid same layer duplicated, apple, amazon, m$AGAIN***** (MUST)
051N-QueensJavaO(n^2)O(1)Hardmatrix, backtrackAGAIN
052N-Queens IIPython,JavaO(n^2)O(1)Hardmatrix, backtrackAGAIN
077CombinationsPython,JavaO(O(k * C(n, k)))O(k)Mediumgood trick, backtrackOK************* (5) (but again, MUST)
079Word SearchPython,JavaO(m * n * l)O(l)MediumLC 212, Curated Top 75, back tracking,good trick,dfs,bloomberg,M$,amazon,fbAGAIN*************** (10) (MUST)
093Restore IP AddressesPythonO(1)O(1)Mediumgood trick,recursive,IP address,amazonAGAIN****** (4)
078SubsetsPython,JavaO(n * 2^n)O(1)Mediumgood concept , similar as, dfs, back track,#90 Subsets II,UBER,amazon,fbAGAIN**************** (7) (MUST again!!!)
090Subsets IIPython,JavaO(n * 2^n)O(1)Mediumgood basic,check# 078 Subsets, dfs, backtrack,fbAGAIN********* (6)
131Palindrome PartitioningPython,JavaO(n^2) ~O(2^n)O(n^2)Mediumdfs, backtrack, good trick,amazonAGAIN*********** (7) (MUST)
139Word BreakPython,JavaO(n * l^2)O(n)MediumCurated Top 75, backtracking, dfs,dp,trick,UBER,yahoo,amazon,google,fbAGAIN**************** (7) (MUST)
140Word Break IIPython,JavaO(n * l^2)O(n)Hardgood basic, LC 078, backtracking, dfs,dp,trick,amazonAGAIN******** (2)
212Word Search IIPython,JavaO(m * n * l)O(l)HardCurated Top 75, LC 208, LC 079, hashset, hashmap, trie, backtrack with trie,amazon, fb, apple, twitter, uber, google, indeedAGAIN********** (3)
216Combination Sum IIIPythonO(k * C(n, k))O(k)MediumAGAIN*
254Factor CombinationsPythonO(nlogn)O(logn)Medium🔒AGAIN (not start)
267Palindrome Permutation IIPythonO(n * n!)O(n)Medium🔒AGAIN (not start*)
294Flip Game IIPythonO(n + c^2)O(c)Medium🔒, DP, HashAGAIN*
320Generalized AbbreviationPythonO(n * 2^n)O(n)Medium🔒AGAIN (not start*)
489Robot Room CleanerPythonO(n * 2^n)O(n)Hard🔒, google, amazon, fb, m$AGAIN (not start)
526Beautiful ArrangementPythonO(n!)O(n)MediumAGAIN (not start*)
676Implement Magic DictionaryPythonO(n)O(d)MediumTrie, DFSAGAIN (not start)
698Partition to K Equal Sum SubsetsPython,JavaO(n * 2^n)O(2^n)Mediumbacktrack, DP, Memoization, similar as#416 Partition Equal Subset Sum, #473 Matchsticks to SquareAGAIN****** (2) (MUST)
718Maximum Length of Repeated SubarrayPythonO(m * n)O(min(m, n))MediumDP, Hash, Binary SearchAGAIN (not start*)
784Letter Case PermutationPythonO(n * 2^n)O(1)Mediumdfs, recursion,good trick,fbAGAIN****** (3)
980Unique Paths IIIPythonO(n * 2^n)O(1)Hardbacktrack, dfs, amazon, google,fbAGAIN**** (1)
1219Path with Maximum GoldJavaO(n * 2^n)O(1)Mediumbacktrack, dfs, bfs, googleAGAIN**** (1)

Dynamic Programming

#TitleSolutionTimeSpaceDifficultyTagStatus
53Maximum SubarrayPython,JavaO(n)O(1)MediumMUST, Curated Top 75, brute force, Kadane algo, pre-sum array,dp basic,amazon,fbAGAIN**************** (8)
62Unique PathsPython,JavaO(m * n)O(m + n)MediumCurated Top 75,2D dp,basic, fb, google, apple, amazon, m$AGAIN**** (3)
63Unique Paths IIPython,JavaO(m * n)O(m + n)Mediumtrick, LC 64, dfs + dp,amazonAGAIN*
64Minimum Path SumPython,JavaO(m * n)O(m + n)MediumSum of grid values ,DP, PQ + BFS, LC 1631,amazonAGAIN*
70Climbing StairsPython,JavaO(logn)O(1)EasyCurated Top 75, Matrix Exponentiation,DP,recursion,appleOK* (2)
72Edit DistancePython,JavaO(logn)O(1)Mediumtop 100 like,DP,recursion,apple, google, amazonagain (not start)
91Decode WaysPython,JavaO(n)O(1)MediumCurated Top 75,good basic,dp,M$,UBER,amazon,fbAGAIN************ (4)
96Unique Binary Search TreesPythonO(n)O(1)Mediumdp, Math, fb, amazonAGAIN* (2) (not start)
115Distinct SubsequencesJavaO(n)O(1)HardAGAIN* (1) (not start)
120TrianglePythonO(m * n)O(n)MediumamazonAGAIN* (not start) (2)
97Interleaving StringJavaO(logn)O(1)Mediumagain (not start)
123Best Time to Buy and Sell Stock IIIPythonO(m * n)O(n)Hardamazon, uber, appleAGAIN* (not start) (1)
152Maximum Product SubarrayPython,JavaO(n)O(1)MediumKadane algo, dp, brute force, Curated Top 75, google, amazon, linkedinAGAIN***** (1)
198House RobberPython,JavaO(n)O(1)EasyCurated Top 75, dp basic,amazonAGAIN*** (2)
213House Robber IIPython,JavaO(n)O(1)Mediumbrute force, recursion, dp, Curated Top 75, google, amazonOK**** (3) (but again)
221Maximal SquarePython,JavaO(n^2)O(n)MediumEPI, dp,amazon,fb, googleAGAIN** (3) (not start)
256Paint HousePython,JavaO(n)O(1)Mediumdp, google, 🔒AGAIN (2)
276Paint FencePythonO(n)O(1)Easy🔒AGAIN
279Perfect SquaresPython,JavaO(n * sqrt(n))O(n)Mediumdp, bfs, brute force, GOOD trick,googleAGAIN******** (3)
303Range Sum Query - ImmutablePythonctor:O(n), lookup:O(1)O(n)EasyOK
304Range Sum Query 2D - ImmutablePython,Javactor:O(m * n), lookup:O(1)O(m * n)Mediumprefix sum,dp,trick,fbAGAIN******* (5)
309Best Time to Buy and Sell Stock with CooldownPython,JavaO(n)O(1)MediumAGAIN (not start)
312Burst BalloonsJavaO(n)O(1)HardAGAIN (not start)
322Coin ChangePython,JavaO(n * k)O(k)MediumCurated Top 75, bfs, dfs, dp, grab, google, fb, apple,amazonAGAIN************* (6) (MUST)
329Longest Increasing Path in a MatrixJavaO(n * k)O(k)Hardneetcode 150, good trick, dfs, dpAGAIN** (1)
351Android Unlock PatternsPythonO(9^2 * 2^9)O(9 * 2^9)Medium🔒 Backtracking, DP,googleAGAIN (not start)
357Count Numbers with Unique DigitsPythonO(n)O(1)MediumBacktracking, MathAGAIN (not start)
361Bomb EnemyPythonO(m * n)O(m * n)Medium🔒 ,googleAGAIN* (2)
363Max Sum of Rectangle No Larger Than KJavaO(m * n)O(m * n)Mediumdp, pre-sum.googleAGAIN* (not start)
368Largest Divisible SubsetPythonO(n^2)O(n)MediumAGAIN (not start)
375Guess Number Higher or Lower IIPythonO(n^2)O(n^2)MediumAGAIN (not start)
377Combination Sum IVPython,JavaO(nlogn + n * t)O(t)MediumCurated Top 75, AGAIN, dp basic ,fbAGAIN******** (3)
403Frog JumpPythonO(nlogn + n * t)O(t)Harddfs, bfs, Memoization dfs, dp, amazon, tik-tok, m$AGAIN (not start)
416Partition Equal Subset SumPython,JavaO(n * s)O(s)Mediumdp, fb, google, apple, amazonAGAIN** (not start) (1)
418Sentence Screen FittingPythonO(r + n * c)O(n)Medium🔒,dp,googleAGAIN (not start)
467Unique Substrings in Wraparound StringPythonO(n)O(1)MediumAGAIN (not start)
471Encode String with Shortest LengthPythonO(n^3) on averageO(n^2)Medium🔒,dp,googleAGAIN (not start)
472Concatenated WordsPythonO(n * l^2)O(n * l)Hardgood trick,trie+dfs,dp,dfs,amazonAGAIN******** (3)
474Ones and ZeroesPythonO(s * m * n)O(m * n)Mediumdp,googleAGAIN (not start)
486Predict the WinnerPythonO(n^2)O(n)Mediumgood basic,dp,googleAGAIN*****
509Fibonacci NumberPythonO(logn)O(1)Easyvariant ofClimbing Stairs,Matrix Exponentiation, SpotifyOK**
516Longest Palindromic SubsequencePythonO(n^2)O(n)Mediumgood DP basic,dp,UBER,amazonAGAIN******
562Longest Line of Consecutive One in MatrixPythonO(m * n)O(n)Medium🔒,dp,googleAGAIN (not start)
552Student Attendance Record IIJavaO(m * n)O(n)Mediumdp,googleAGAIN (not start)
576Out of Boundary PathsPythonO(N * m * n)O(m * n)Mediumdp,bfsAGAIN (not start)
583Delete Operation for Two StringsPythonO(m * n)O(n)Mediumdp,googleAGAIN (not start)
6502 Keys KeyboardPythonO(sqrt(n))O(1)Mediumdp,dp basic ,M$AGAIN*
673Number of Longest Increasing SubsequencePythonO(n^2)O(n)Mediumdp,good trick,fbAGAIN********** (3)
688Knight Probability in ChessboardPythonO(k * n^2)O(n^2)Mediumdp,dp basic,AGAIN,M$,Goldman Sachs,google,fb,amazonAGAIN********* (5)
712Minimum ASCII Delete Sum for Two StringsPythonO(m * n)O(n)MediumdpAGAIN (not start)
714Best Time to Buy and Sell Stock with Transaction FeePython,JavaO(n)O(1)MediumAGAIN,good basic,dp,greedy,fb, googleAGAIN******** (3)
727Minimum Window SubsequenceJavaO(n)O(1)Harddp,googleAGAIN (not start)
740Delete and EarnPythonO(n)O(1)MediumAGAIN (not start)
746Min Cost Climbing StairsPython,JavaO(n)O(1)Easygood dp basic,dp,amazonAGAIN**** (2)
750Number Of Corner RectanglesPythonO(n * m^2)O(n * m)Mediumdp,fbAGAIN (3) (not start)
764Largest Plus SignPythonO(n^2)O(n^2)Mediumdp, complex ,fbAGAIN (not start) (2)
788Rotated DigitsPythonO(logn)O(logn)EasyBrute Force, MemoizationOK*
790Domino and Tromino TilingPythonO(logn)O(1)MediumMatrix Exponentiation,dp,googleAGAIN (not start)
799Champagne TowerPythonO(n^2)O(n)MediumdpAGAIN
801Minimum Swaps To Make Sequences IncreasingPython,JavaO(n)O(1)Mediumdp,amazon,fbAGAIN***** (not start) (2)
808Soup ServingsPythonO(1)O(1)MediumAGAIN (not start)
813Largest Sum of AveragesPythonO(k * n^2)O(n)Mediumdp,googleAGAIN (not start)
823Binary Trees With FactorsPythonO(n^2)O(n)MediumdpAGAIN (not start)
837New 21 GamePython,JavaO(n)O(n)Mediumdp, trick, math,googleAGAIN (2) (not start)
838Push DominoesPythonO(n)O(n)Mediumdp,two pointers,googleAGAIN (not start)
871Minimum Number of Refueling StopsJavaO(n)O(n)Harddp,heap,googleAGAIN (not start)
877Stone GamePythonO(n^2)O(n)Mediumvariant ofPredict the WinnerAGAIN (not start)
926Flip String to Monotone IncreasingPythonO(n)O(1)Mediumgood trick, dp, prefix sum,google,amazonAGAIN********** (4)
931Minimum Falling Path SumPythonO(n^2)O(1)Mediumgoogle,goldman sachsAGAIN (not start)
935Knight DialerPythonO(logn)O(1)MediumMatrix Exponentiation,google,M$,fbAGAIN (not start)
518Coin Change 2Python,JavaO(logn)O(1)Mediumdp basic,good trick,check# 322 Coin Change,dp,google,fbAGAIN******** (4)
494Target SumPython,JavaO(logn)O(1)Mediumdp basic,dp,fbAGAIN***** (1)
1000 Minimum Cost to Merge StonesPythonO(logn)O(1)Mediumdp, amazonAGAIN (not start)
1048Longest String ChainJavaO(logn)O(1)Mediumdp, googleAGAIN (not start)
1049Last Stone Weight IIJavaO(logn)O(1)MediumdpAGAIN (not start)
1137N-th Tribonacci NumberJavaO(logn)O(1)Easydp, good basicAGAIN**
1143Longest Common SubsequencePython,JavaO(logn)O(1)MediumCurated Top 75, Memoization, dp, amazon, karatAGAIN*** (3) (not start)
1312Minimum Insertion Steps to Make a String PalindromePythonO(logn)O(1)Harddp, amazonAGAIN (not start)
1335Minimum Difficulty of a Job SchedulePythonO(logn)O(1)Mediumdp,amazonnot start
1406Stone Game IIIJavaO(logn)O(1)Mediumdp,amazonAGAIN (not start)
1799Maximize Score After N OperationsPythonO(logn)O(1)Mediumdp,amazonnot start
3196 Maximize Total Cost of Alternating SubarraysJavaO(logn)O(1)Mediumdp, LC weeklyAgain

Greedy

#TitleSolutionTimeSpaceDifficultyTag, NoteStatus
011Container With Most WaterPython,JavaO(n)O(1)MediumCurated Top 75, good basics,two pointers,fb, amazonOK*** (3) (but again !!)
045Jump Game IIPython,JavaO(n)O(1)MediumGreedy, google, apple, fb, tesla,amazonAGAIN******** (4) (MUST)
055Jump GamePython,JavaO(n)O(1)MediumCurated Top 75, good trick, backtrack, Greedy, DP,amazonAGAIN******** (8)
84Largest Rectangle in HistogramPython,JavaO(n)O(1)Hardtop 100 like, brute force, good trick,mono stack, LC 085, amazon, fbAGAIN******** (3)
122Best Time to Buy and Sell Stock IIPython,JavaO(n)O(1)Easycompare with#309 Best Time to Buy and Sell Stock with Cooldown,#714 Best Time to Buy and Sell Stock with Transaction Fee,amazonagain* (2)
134Gas StationPython,JavaO(n)O(1)Mediumtrick, greedy,amazonAGAIN****** (5)
135CandyPython,JavaO(n)O(1)HardLC 123, greedy, boundary, array,amazonAGAIN (2)
218The Skyline ProblemPythonO(n)O(1)Hardbrute force, swipe line, Priority Queue, Union Find, Divide-and-Conquer, apple, microsoftAGAIN (not start)
316Remove Duplicate LettersJavaO(n)O(1)Mediumstack, char, visitedAGAIN**** (2)
330Patching ArrayPythonO(n)O(1)Hardarray, greedy,amazonAGAIN (not start)
358Rearrange String k Distance ApartPythonO(n)O(1)Mediumheap, greedy, check LC 767not start
376Wiggle SubsequencePythonO(n)O(1)MediumAGAIN*
392Is SubsequencePythonO(n)O(1)MediumbasicsOK*
397Integer ReplacementPythonO(n)O(1)MediumRecursion basics, MathOK*
402Remove K DigitsPythonO(n)O(n)MediumLintCodeAGAIN (not start*)
435Non-overlapping IntervalsPython,JavaO(nlogn)O(1)MediumCurated Top 75, good trick, max free space, inverval, LC 452, Line Sweep,googleAGAIN************ (9)
452Minimum Number of Arrows to Burst BalloonsPython,JavaO(nlogn)O(1)Mediumsort, compare i-1 element, overlap, good basicAGAIN***** (3)
455Assign CookiesPythonO(nlogn)O(1)EasyOK*
621Task SchedulerPython,JavaO(n)O(1)Mediumtrick,array,greedy,fb,amazonAGAIN****** (7)
646Maximum Length of Pair ChainPythonO(nlogn)O(1)Mediumgood trick, greedy, similar as#435 Non-overlapping Intervals, Line Sweep,amazonOK********** (5) (but again)
649Dota2 SenatePython,JavaO(n)O(n)Mediumcomplex questionAGAIN (not start*)
659Split Array into Consecutive SubsequencesPython,JavaO(n)O(1)Mediummap, pq, greedy, dp,googleAGAIN***** (1)
738Monotone Increasing DigitsPythonO(1)O(1)Mediumgood trick, greedy, string, trick,AmazonAGAIN********* (4)
763Partition LabelsPython,JavaO(n)O(S)Mediumgreedy,good trick ,dict,sliding window,amazonAGAIN******* (6) (AGAIN)
767Reorganize StringPython,JavaO(n)O(1)MediumPQ, hashmap,good trick,amazon,fb, googleAGAIN****************** (9) (MUST)
861Score After Flipping MatrixPythonO(r * c)O(1)MediumAGAIN (not start*)
870Advantage ShufflePythonO(nlogn)O(n)MediumOK*
881Boats to Save PeoplePython,JavaO(nlogn)O(n)Mediumgood trickAGAIN* (2)
948Bag of TokensPythonO(nlogn)O(1)MediumTwo PointersAGAIN (not start)
962Maximum Width RampPythonO(n)O(n)MediumDescending StackAGAIN (not start)
978Longest Turbulent SubarrayJavaO(n)O(n)Mediumsliding windowAGAIN (not start)
1024Video StitchingPythonMediumSpotifyAGAIN (not start)
1102Path With Maximum Minimum ValuePythonMediumdfs, dp , greedy,amazonnot start
319Bulb SwitcherPythonMediumnot start
672Bulb Switcher IIPythonMediumnot start
1375Bulb Switcher IIIPythonMediumqueue, array,gra*AGAIN*** (1)
1648Sell Diminishing-Valued Colored BallsPythonMediumtrick, sorting, heapq, binary search, greedy,amazonAGAIN*** (2) (not start)
1710Maximum Units on a TruckPythonEasysort, greedy,amazonAGAIN******** (3) (MUST)
1851Minimum Interval to Include Each QueryJavaHardsort, greedy,googleAGAIN (not start)
1871Jump Game VIIJavaMediumgreedy, bfsAGAIN (not start)
1899Merge Triplets to Form Target TripletJavaMediumsort, greedy,amazonAGAIN(1) (not srart)
3689Maximum Total Subarray Value IJavaMediummath, brute forceOK
3690Split and Merge Array TransformationJavaMediumbfs dfsAGAIN (not start)
3691Maximum Total Subarray Value IIJavahardbrute force, treeAGAIN

Graph

#TitleSolutionTimeSpaceDifficultyStatusNote
269Alien DictionaryPython,JavaHardCurated Top 75, good trick, dfs, bfs, Topologicals sort,fb, google, m$, airbnb, uber, amazonAGAIN********** (6)
323Number of Connected Components in an Undirected GraphPython,JavaO(n)O(n)MediumCurated Top 75, LC 547, 🔒 , bfs, dfs, Union Find,graph,linkedin,amazon, fb, google, m$, linkedinAGAIN************** (6) (MUST)
778Swim in Rising WaterJavaO(n)O(n)Mediumgraph, DijkstraAGAIN1 (1) (not start)
959Regions Cut By SlashesPythonO(n^2)O(n^2)MediumUnion Findagain
997Find the Town JudgeJavaO(n^2)O(n^2)Easygraphagain
1135Connecting Cities With Minimum CostPythonO(n^2)O(n^2)Mediumunion find, Kruskal, prime, graph, amazonAGAIN (not start)
1462Course Schedule IVJavaO(n^2)O(n^2)MediumAGAIN (not start)
1489Find Critical and Pseudo-Critical Edges in Minimum Spanning TreeJavaO(n^2)O(n^2)Harddfs, bfs, DijkstraAGAIN (not start)
1584Min Cost to Connect All PointsJavaO(n^2)O(n^2)MediumKruskal algo, Prim algo, advanced graphAGAIN (not start)
1631Path With Minimum EffortJavaO(n^2)O(n^2)HardMax of step differences, dfs, bfs+PQ, LC 64, DijkstraAGAIN**** (1)
2290Minimum Obstacle Removal to Reach CornerJavaO(n^2)O(n^2)Hardbfs, PQ, Dijkstra classicsAGAIN****** (2)(MUST)
2392Build a Matrix With ConditionsJavaO(n^2)O(n^2)Harddfs, bfs, DijkstraAGAIN (not start)
2508Add Edges to Make Degrees of All Nodes EvenJavaO(n^2)O(n^2)Hardgraph, LC weeklyAGAIN (not start)
2709Greatest Common Divisor TraversalJavaO(n^2)O(n^2)HardAGAIN (not start)

Geometry

#TitleSolutionTimeSpaceDifficultyStatusNote
892Surface Area of 3D ShapesC++PythonO(n^2)O(1)Easy
0587Erect the FencePythonO(nlogn)O(n)Hardcomplex, Convex Hull,Monotone Chain ,amazon
0892Surface Area of 3D Shapes

Design

#TitleSolutionTimeSpaceDifficultyTagNote
146LRU CachePython,JavaO(1)O(k)Mediumgood basic, LRU, Least Recently Used, Double Linkedlist, LinkedHashMap, OrderedDict, priority queue,amazonAGAIN****** (4)
225Implement Stack using QueuesPython,Javapush:O(n), pop:O(1), top:O(1)O(n)EasyAGAIN** (1)(MUST)
284Peeking IteratorC++PythonO(1)O(1)Mediumgood basic,google, applenot start*** (1)
348Design Tic-Tac-ToePythonO(1)O(n^2)Mediummatrix, array, 🔒, google,fb,amazonAGAIN****** (5)
353Design Snake GamePython,JavaO(1)O(s)Mediumgood trick, Deque, 🔒, amazon, google, square, m$AGAIN*** (1)
355Design TwitterPython,JavaO(klogu)O(t + f)Mediumgood trick, data structure, heapq, defaultdict,amazonOK******** (6)
362Design Hit CounterJavaO(1), amortizedO(k)Medium🔒Deque,google
379Design Phone DirectoryJavaO(1)O(n)Medium🔒, queue, google
380Insert Delete GetRandom O(1)Python,JavaO(1)O(n)Medium/Hardset, list, dict,amazon,fb, googleOK* (5)
0381Insert Delete GetRandom O(1) - Duplicates allowedC++PythonO(1)O(n)Hard
432All O`one Data StructureC++PythonO(1)O(n)Hard
460LFU CachePython,JavaO(1)O(k)HardLeast Frequently Used (LFU) cache, complex,amazonAGAIN*** (3)
535Encode and Decode TinyURLPython,JavaO(1)O(n)Mediumhash map, "duplicated", "hash map collision" ,UBER,amazon,google ,fb, designOK**** (5)
588Design In-Memory File SystemC++Pythonls:O(l + klogk)
mkdir:O(l)
addContentToFile:O(l + c)
readContentFromFile:O(l + c)
O(n + s)Harddict, a bit complex basic, 🔒, shoptify, amazonAGAIN******* (3)
0604Design Compressed String IteratorC++PythonO(1)O(1)Easy🔒
622Design Circular qequePythonMedium🔒AGAIN(2)
631Design Excel Sum FormulaC++Pythonset:O((r * c)^2)
get:O(1)
sum:O((r * c)^2)
O(r * c)Hard🔒
635Design Log Storage SystemC++Pythonput:O(1)
retrieve:O(n + dlogd)
O(n)Medium🔒
641Design Circular DequePythonMedium🔒
642Design Search Autocomplete SystemPythonO(p^2)O(p * t + s)Hard🔒,amazonAGAIN**** (not start) (5)
705Design HashSetPythonEasy
706Design HashMapPythonEasy
0715Range ModuleC++Pythonadd:O(n)
remove:O(n)
query:O(logn)
O(n)Hard
716Max StackPythonpush:O(logn)
pop:O(logn)
popMax:O(logn)
top:O(1)
peekMax:O(1)
O(n)Easybasic, stack,amazonagain*
745Prefix and Suffix SearchPythonctor:O(w * l^2)
search :O(p + s)
O(t)HardTrie,fbNot start* (1) (good basic)
900RLE IteratorC++Python,JavaO(n)O(1)Mediumgoogle, treemap, arrayAGAIN (not start) (1)
1146Snapshot ArrayJavaset:O(1)
get:O(logn)
O(n)MediumtreeMap, binary search, googleAGAIN*** (1)
1166Design File SystemC++Pythoncreate:O(n)
get:O(n)
O(n)Medium🔒, design, google, airbnb, amazonAGAIN***** (1)
1172Dinner Plate StacksC++Pythonpush:O(logn)
pop:O(1), amortized
popAtStack:(logn)
O(n * c)Hard
1188Design Bounded Blocking QueueJavapush:O(logn)
pop:O(1), amortized
popAtStack:(logn)
O(n * c)Mediumgoogle, SemaphoreAGAIN (not start)
1206Design SkiplistC++PythonO(logn), on averageO(n)Hard
1236Web CrawlerC++PythonO(|V| + |E|)O(|V|)Medium🔒, BFS, DFS
1244Design A LeaderboardC++Pythonctor:O(1)
add:O(1)
top:O(n)
reset:O(1)
O(n)Medium
1268Search Suggestions SystemPython,Javactor:O(n * l)
suggest:O(l^2)
O(t)Mediumgood basic, array, heap, sort, Trie,amazonAGAIN******** (3)
1286Iterator for CombinationPythonO(k)O(k)MediumStack
1429First Unique NumberPythonO(k)O(k)Mediumgood trick, heap,amazonAGAIN*** (not start)
1472Design Browser HistoryPythonO(k)O(k)MediumAGAIN
1500Design a File Sharing SystemPythonO(k)O(k)Mediumdesign, hashmapAGAIN*** (not start)
1603Design Parking SystemPythonO(k)O(k)Easydesign, amazon , paypalOK
1628Design an Expression Tree With Evaluate FunctionPythonO(k)O(k)Mediumcomplex, design,amazonAGAIN*** (not start)
1656Design an Ordered StreamPythonO(k)O(k)Easy
1670Design Front Middle Back QueuePythonO(k)O(k)Mediumgood basic, Design,amazonAGAIN** (1) (not start)
1756Design Recent Used QueuePythonO(k)O(k)Mediumdesign, queueAGAIN
1797Design Authentication ManagerPythonO(k)O(k)Mediumdesign, hashmapAGAIN
1976Number of Ways to Arrive at DestinationPythonO(k)O(k)Medium

Simulation

#TitleSolutionTimeSpaceDifficultyStatusNote
874Walking Robot SimulationC++PythonO(n + k)O(k)Easy

Concurrency

#TitleSolutionTimeSpaceDifficultyTagNote
1114Print in OrderC++PythonO(n)O(1)Easy
1115Print FooBar AlternatelyC++PythonO(n)O(1)Medium
1116Print Zero Even OddC++PythonO(n)O(1)Medium
1117Building H2OC++PythonO(n)O(1)Hard
1188Design Bounded Blocking QueueC++PythonO(n)O(1)Medium🔒
1195Fizz Buzz MultithreadedC++PythonO(n)O(1)Medium
1226The Dining PhilosophersC++PythonO(n)O(1)Medium
1242Web Crawler MultithreadedC++PythonO(|V| + |E|)O(|V|)Medium🔒
1279Traffic Light Controlled IntersectionC++PythonO(n)O(1)Easy🔒

SQL

#TitleSolutionTimeSpaceDifficultyTag, NoteStatus
0175Combine Two TablesMySQLO(m + n)O(m + n)EasyOK (4)
0176Second Highest SalaryMySQLO(n)O(1)Easyamazon,fbOK (4)
0177Nth Highest SalaryMySQLO(n^2)O(n)MediumMySQL PROCEDURE,SQL FAQAGAIN*** (3)
0178Rank ScoresMySQLO(n^2)O(n)Mediumtrick,SQL var, ank, select same table, rankAGAIN****** (7)
0180Consecutive NumbersMySQLO(n)O(n)MediumSQL var, join same table multi timesOK* (3)
0181Employees Earning More Than Their ManagersMySQLO(n^2)O(1)EasyOK
0182Duplicate EmailsMySQLO(n^2)O(n)EasyOK
0183Customers Who Never OrderMySQLO(n^2)O(1)Easyleft joinOK** (3) (but again)
0184Department Highest SalaryMySQLO(n^2)O(n)Mediumtrick, where, good basicOK***** (but again) (6)
0185Department Top Three SalariesMySQLO(n^2)O(n)Hardsimiliar as# 0177 Nth Highest Salary, good trick, top N in groupAGAIN******** (5)
0196Delete Duplicate EmailsMySQLO(n^2)O(n)Easy, delete commandAGAIN (2)
0197Rising TemperatureMySQLO(n^2)O(n)EasyOK
0262Trips and UsersMySQLO((t * u) + tlogt)O(t)Hardcase condisionsOK* (2)
0511Game Play Analysis IMySQLO(n)O(n)Easy🔒OK
0512Game Play Analysis IIMySQLO(n)O(n)Easy🔒,2 col wheregood trickAGAIN**(4)
0534Game Play Analysis IIIMySQLO(nlogn)O(n)Medium🔒,SQL var,tricky, window funcAGAIN******** (6)
0550Game Play Analysis IVMySQLO(n)O(n)Mediumcase, fraction, join, good basic, where min conditionOK*********** (7) (but again)
569Median Employee SalaryMySQLO(n)O(n)Mediummedium numberAGAIN* (not start)
571Find Median Given Frequency of NumbersMySQLO(n)O(n)Mediummedium numberAGAIN** (not start) (2)
577Employee BonusMySQLO(n)O(n)EasyOK
578Get Highest Answer Rate QuestionMySQLMediumfb, case conditionOK* (3)
579Find Cumulative Salary of an EmployeeMySQLHardwindow function,amazon, good trickOK***** (5)(but again)
580Count Student Number in DepartmentsMySQLMediumOK*** (2) (but again)
595Big CountriesMySQLEasyOK
597Friend Requests I: Overall Acceptance RateMySQLMediumselect distinct, ifnull,fbOK*** (7)
601Human Traffic of StadiumMySQLHardconsecutive numsOK* (1)
602Friend Requests II: Who Has Most Friend?MySQLMediumunion all,fbOK*** (4)
603Consecutive Available SeatsMySQLMediumconsecutive nums, good basic, cross joinOK***** (3)(but again)
618Students Report By GeographyMySQLHardsql varAGAIN (not start)
620Not Boring MoviesMySQLEasyOK
626Exchange SeatsMySQLMediumAGAIN (not start)
627Swap SalaryMySQLEasyUPDATE with CASE, good basicOK* (1) (but again)
1045Customers Who Bought All ProductsMySQLO(n + k)O(n + k)Medium🔒, where with countOK*** (4)
1050Actors and Directors Who Cooperated At Least Three TimesMySQLO(n)O(n)Easy🔒OK
1068Product Sales Analysis IMySQLO(m + n)O(m + n)Easy🔒OK
1069Product Sales Analysis IIMySQLO(n)O(n)Easy🔒OK
1070Product Sales Analysis IIIMySQLO(n)O(n)Medium🔒OK
1075Project Employees IMySQLO(m + n)O(m + n)Easy🔒OK
1076Project Employees IIMySQLO(n)O(n)Easy🔒OK (2)
1077Project Employees IIIMySQLO((m + n)^2)O(m + n)Medium🔒,tricky whereOK***** (2) (but again)
1082Sales Analysis IMySQLO(n)O(n)Easy🔒, group by only 1 col, good basicOK***** (5) (again)
1083Sales Analysis IIMySQLO(m + n)O(m + n)Easy🔒, not inOK*** (3) (again)
1084Sales Analysis IIIMySQLO(m + n)O(m + n)Easy🔒OK** (2)
1097Game Play Analysis VMySQLO(n^2)O(n)Hard🔒,good basic,retention, case condition, retention, data_add, left joinAGAIN******* (8)
1098Unpopular BooksMySQLO(m + n)O(n)Medium🔒, where not inOK* (2)
1107New Users Daily CountMySQLO(n)O(n)Medium🔒OK*
1112Highest Grade For Each StudentMySQLO(nlogn)O(n)Medium🔒, good basicOK** (4)
1113Reported PostsMySQLO(n)O(n)Easy🔒OK
1126Active BusinessesMySQLO(n)O(n)Medium🔒,good basicAGAIN*** (3)
1127User Purchase PlatformMySQLO(n)O(n)Hard🔒,complex, union all, caseOK**** (6) (but again)
1132Reported Posts IIMySQLO(m + n)O(n)Medium🔒OK*** (4)
1141User Activity for the Past 30 Days IMySQLO(n)O(n)Easy🔒AGAIN* (2)
1142User Activity for the Past 30 Days IIMySQLO(n)O(n)Easy🔒AGAIN* (1)
1148Article Views IMySQLO(nlogn)O(n)Easy🔒OK
1149Article Views IIMySQLO(nlogn)O(n)Medium🔒OK*
1158Market Analysis IMySQLO(m + n)O(m + n)Medium🔒,case when ... is not nullAGAIN**** (5)
1159Market Analysis IIMySQLO(m + n)O(m + n)Hard🔒, good trickAGAIN** (3)
1164Product Price at a Given DateMySQLO(mlogn)O(m)Medium🔒, good trick, union, case, not in a periodAGAIN******** (2)
1173Immediate Food Delivery IMySQLO(n)O(1)Easy🔒OK
1174Immediate Food Delivery IIMySQLO(n)O(m)Medium🔒OK**** (3)
1179Reformat Department TableMySQLO(n)O(n)Easy🔒OK
1193Monthly Transactions IMySQLO(n)O(n)Medium🔒OK (2)
1194Tournament WinnersMySQLO(m + n + nlogn)O(m + n)Hard🔒AGAIN*
1204Last Person to Fit in the ElevatorMySQLO(nlogn)O(n)Medium🔒, cumsum, window func, good basicOK****** (3)
1205Monthly Transactions IIMySQLO(n)O(n)Medium🔒, good trick, union all, case conditionsOK*** (3) (but again)
1211Queries Quality and PercentageMySQLO(n)O(n)EasyOK
1212Team Scores in Football TournamentMySQLO(nlogn)O(n)Mediumgood trickOK** (2)
1225Report Contiguous DatesMySQLO(nlogn)O(n)Hard🔒AGAIN* (2) (not start)
1241Number of Comments per PostMySQLO(n)O(n)Easy🔒, good basicOK**** (5) (but again)
1251Average Selling PriceMySQLO(n)O(n)Easy🔒, good basicOK*** (but again) (3)
1264Page RecommendationsMySQLO(m + n)O(m)Medium🔒OK** (2)
1270All People Report to the Given ManagerMySQLO(n)O(n)Medium🔒, good basicOK* (3)
1280Students and ExaminationsMySQLO((m * n) * log(m * n))O(m * n)Easy🔒OK (1)
1285Find the Start and End Number of Continuous RangesMySQLO(n)O(n)Medium🔒, variableAGAIN (not start) (1)
1294Weather Type in Each CountryMySQLO(m + n)O(n)Easy🔒OK (1)
1303Find the Team SizeMySQLO(n)O(n)Easy🔒ok (1)
1308Running Total for Different GendersMySQLO(nlogn)O(n)Medium🔒, good basic, union all, window funcOK**** (3)
1321Restaurant GrowthMySQLO(n^2)O(n)Medium🔒, good basic, trickAGAIN***** (3)
1322Ads PerformanceMySQLO(nlogn)O(n)Easy🔒, good basicOK******* (3) (but again)
1327List the Products Ordered in a PeriodMySQLO(n)O(n)Easy🔒OK
1336Number of Transactions per VisitMySQLO(m + n)O(m + n)Medium🔒, complex, variableAGAIN (not start)
1341Movie RatingMySQLO(nlogn)O(n)Medium🔒AGAIN (not start)
1350Students With Invalid DepartmentsMySQLO(n)O(n)Easy🔒OK
1355Activity ParticipantsMySQLO(n)O(n)Medium🔒OK
1364Number of Trusted Contacts of a CustomerMySQLO(n + m + l + nlogn)O(n + m + l)Medium🔒OK
1369Get the Second Most Recent ActivityMySQLO(nlogn)O(n)Hard🔒, union, havingOK** (2) (but again)
1378Replace Employee ID With The Unique IdentifierMySQLO(n)O(n)Easy🔒OK
1384Total Sales Amount by YearMySQLO(nlogn)O(n)Hard🔒, complexOK*
1393Capital Gain/LossMySQLO(n)O(n)Medium🔒OK
1398Customers Who Bought Products A and B but Not CMySQLO(m + n)O(m + n)Medium🔒OK
1407Top TravellersMySQLO(m + nlogn)O(m + n)Easy🔒, ifnullOK*
1412Find the Quiet Students in All ExamsMySQLO(m + nlogn)O(m + n)Hard🔒, good trick, not in, inner join on multiple colsOK**** (3) (but again)
1421NPV QueriesMySQLO(n)O(n)Medium🔒OK
1435Create a Session Bar ChartMySQLO(n)O(1)Easy🔒OK
1440Evaluate Boolean ExpressionMySQLO(n)O(n)Medium🔒OK
1445Apples & OrangesMySQLO(n)O(n)Medium🔒OK
1454Active UsersMySQLO(nlogn)O(n)Medium🔒, good basic, window funcAGAIN*** (2)
1459Rectangles AreaMySQLO(n^2)O(n^2)Medium🔒OK*
1468Calculate SalariesMySQLO(m + n)O(m + n)Easy🔒OK*
1479Sales by Day of the WeekMySQLO(m + n)O(n)Hard🔒, case, DAYOFWEEKOK
1484Group Sold Products By The DateMySQLO(nlogn)O(n)Easy🔒,GROUP_CONCATOK*
1495Friendly Movies Streamed Last MonthMySQLO(n)O(n)Easy🔒OK
1501Countries You Can Safely Invest InMySQLO(n)O(n)Medium🔒,good trick, group avg, global avg, SUBSTRING, inner join onor conditionsOK****** (4)
1511Customer Order FrequencyMySQLO(n)O(n)Easy🔒, having, likeOK* (1)
1517Find Users With Valid E-MailsMySQLO(n)O(n)Easy🔒, regular expressionAGAIN
1527Patients With a ConditionMySQLO(n)O(n)Easy🔒OK
1532The Most Recent Three OrdersMySQLO(nlogn)O(n)Medium🔒, window func, good basicOK** (2) (but again)
1543Fix Product Name FormatMySQLO(nlogn)O(n)Easy🔒, trimOK
1549The Most Recent Orders for Each ProductMySQLO(nlogn)O(n)Medium🔒, max day per id, good basicOK* (again)
1555Bank Account SummaryMySQLO(m + n)O(m + n)Medium🔒, union all, good trickOK**** (2)(but again)
1565Unique Orders and Customers Per MonthMySQLO(n)O(n)Easy🔒OK
1571Warehouse ManagerMySQLO(n)O(n)Medium🔒OK* (1)
1581Customer Who Visited but Did Not Make Any TransactionsMySQLO(n)O(n)Easy🔒, left join, good basicOK** (2)(but again)
1587Bank Account Summary IIMySQLO(m + n)O(m + n)Easy🔒OK
1596The Most Frequently Ordered Products for Each CustomerMySQLO(n)O(n)Medium🔒, good trick,rank() ORDER BY count, get max in each groupOK********* (3)(but again)
1607Sellers With No SalesMySQLO(nlogm)O(n + m)Medium🔒OK
1613Find the Missing IDsMySQLO(n^2)O(n)Medium🔒,RECURSIVE CTE, good trickAGAIN*** (2)
1623All Valid Triplets That Can Represent a CountryMySQLO(n^3)O(n^3)Easy🔒,<>AGAIN* (not start)
1633Percentage of Users Attended a ContestMySQLO(m + nlogn)O(n)Easy🔒OK
1635Hopper Company Queries IMySQLO(d + r + tlogt)O(d + r + t)Hard🔒, complexAGAIN (not start)
1645Hopper Company Queries IIMySQLO(d + r + tlogt)O(d + r + t)Hard🔒, complexAGAIN (not start)
1651Hopper Company Queries IIIMySQLO(d + r + tlogt)O(d + r + t)Hard🔒, complexAGAIN (not start)
1661Average Time of Process per MachineMySQLO(n)O(n)Easy🔒, good basicOK* (1)
1667Fix Names in a TableMySQLO(nlogn)O(n)Easy🔒, concat, sub-stringOK (1)
1677Product's Worth Over InvoicesMySQLO(nlogn)O(n)Easy🔒OK
1683Invalid TweetsMySQLO(n)O(n)Easy🔒OK
1693Daily Leads and PartnersMySQLO(n)O(n)Easy🔒OK
1699Number of Calls Between Two PersonsMySQLO(n)O(n)Medium🔒, cte, union allOK* (1)(but again)
1709Biggest Window Between VisitsMySQLO(nlogn)O(n)Medium🔒, window func, datediff, coalesce, good trickAGAIN***** (2)
1715Count Apples and OrangesMySQLO(n)O(n)Medium🔒, ifnullOK (2)
1729Find Followers CountMySQLO(nlogn)O(n)Easy🔒OK
1731The Number of Employees Which Report to Each EmployeeMySQLO(nlogn)O(n)Easy🔒OK
1741Find Total Time Spent by Each EmployeeMySQLO(nlogn)O(n)Easy🔒OK
1747Leetflex Banned AccountsMySQLO(n^2)O(n)Medium🔒OK (2) (but again)
1757Recyclable and Low Fat ProductsMySQLO(n)O(n)Easy🔒OK
1767Find the Subtasks That Did Not ExecuteMySQLO(n * c)O(n * c)Hard🔒,RECURSIVE CTEAGAIN (not start)
1777Product's Price for Each StoreMySQLO(n)O(n)Easy🔒OK (2)
1783Grand Slam TitlesMySQLO(n)O(n)Medium🔒, union all, good basicOK* (1) (but again)
1789Primary Department for Each EmployeeMySQLO(n)O(n)Easy🔒, where id inOK (1) (but again)
1795Rearrange Products TableMySQLO(n)O(n)Easy🔒, union all, good basicOK****** (2)
1809Ad-Free SessionsMySQLO(n)O(n)Easy🔒, left join where col is nullOK**** (3)(but again)
1811Find Interview CandidatesMySQLO(nlogn)O(n)Medium🔒, union all, cte, where,good basicAGAIN* (2)
1821Find Customers With Positive Revenue this YearMySQLO(n)O(n)Easy🔒OK
1831Maximum Transaction Each DayMySQLO(nlogn)O(n)Medium🔒, rank(), where on 2 attr, good basicAGAIN**** (2)
1841League StatisticsMySQLO(nlogn)O(n)Medium🔒, case, complexAGAIN* (2)
1843Suspicious Bank AccountsMySQLO(nlogn)O(n)Medium🔒, good trick, window funcOK** (2) (but AGAIN)
1853Convert Date FormatMySQLO(n)O(n)Easy🔒OK
1867Orders With Maximum Quantity Above AverageMySQLO(n)O(n)Easy🔒OK (1)
1873Calculate Special BonusMySQLO(n)O(n)Easy🔒, left, odd numOK (2)
1875Group Employees of the Same SalaryMySQLO(nlogn)O(n)Medium🔒, complex, good basicAGAIN* (1)
1890The Latest Login in 2020MySQLO(n)O(n)Easy🔒OK
1892Page Recommendations IIMySQLO(n * m)O(n * m) Hard🔒AGAIN*** (1) (not start)
1907Count Salary CategoriesMySQLO(n)O(n)Medium🔒, union allOK* (1)
1917Leetcodify Friends RecommendationsMySQLO(n^2)O(n^2)Hard🔒,NOT EXISTSAGAIN*** (2)
1919Leetcodify Similar FriendsMySQLO(n * l)O(n * l)Hard🔒AGAIN* (not start)
1934Confirmation RateMySQLO(n + m)O(n + m)Medium🔒, good basicOK* (1) (but again)
1939Users That Actively Request Confirmation MessagesMySQLO(nlogn)O(n)Easy🔒, TIMESTAMPDIFF, good basicOK*** (2) (but again)
1949Strong FriendshipMySQLO(n^3)O(n^2)Medium🔒good basic, where in 2 cols
1951All the Pairs With the Maximum Number of Common FollowersMySQLO(n^3)O(n^2)Medium🔒, good trickAGAIN* (2)
1965Employees With Missing InformationMySQLO(nlogn)O(n)Easy🔒, good basicOK* (1) (but again)
1972First and Last Call On the Same DayMySQLO(n)O(n)Hard🔒, rank, union all, amazonAGAIN** (2)
1978Employees Whose Manager Left the CompanyMySQLO(nlogn)O(n)Easy🔒OK (1)
1988Find Cutoff Score for Each SchoolMySQLO(n * m)O(n * m)Medium🔒, no refAGAIN (not start)
1990Count the Number of ExperimentsMySQLO(n)O(n)Easy🔒, cross joinAGAIN* (1)
2004The Number of Seniors and Juniors to Join the CompanyMySQLO(nlogn)O(n)Hard🔒, not refAGAIN (not start)

Shell Script

#TitleSolutionTimeSpaceDifficultyTagNote
0192Word FrequencyShellO(n)O(k)Medium
0193Valid Phone NumbersShellO(n)O(1)Easy
0194Transpose FileShellO(n^2)O(n^2)Medium
0195Tenth LineShellO(n)O(1)Easy

About

My CS learning : algorithm, data structure, and system design | #SE

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors2

  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp