All Projects โ†’ yennanliu โ†’ CS_basics

yennanliu / CS_basics

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

Programming Languages

python
139335 projects - #7 most used programming language
java
68154 projects - #9 most used programming language
Jupyter Notebook
11667 projects
javascript
184084 projects - #8 most used programming language
scala
5932 projects
shell
77523 projects

Projects that are alternatives of or similar to CS basics

go-time-series
Time series implementation in Go
Stars: โœญ 27 (+28.57%)
Mutual labels:  data-structure
resources-to-master-software-engineering-interview-for-non-cs-majors
๐Ÿ“– Resources To Master Software Engineering Interview for Non CS Majors
Stars: โœญ 44 (+109.52%)
Mutual labels:  system-design
data-structures-algorithms
Self-practice in Data Structures & Algorithms
Stars: โœญ 29 (+38.1%)
Mutual labels:  data-structure
trie
Trie (a.k.a. prefix tree) C# implementation. Has constant-time string prefix lookup.
Stars: โœญ 84 (+300%)
Mutual labels:  data-structure
linked-blocking-multi-queue
A concurrent collection that extends the existing Java concurrent collection library, offering an optionally-bounded blocking "multi-queue" based on linked nodes.
Stars: โœญ 41 (+95.24%)
Mutual labels:  data-structure
LLD
Curated Collection of all Low level design Questions and implementation asked in major Tech companies , Get yourself prepared for the LLD round and ace the interview.
Stars: โœญ 608 (+2795.24%)
Mutual labels:  system-design
CP
Competitive Coding
Stars: โœญ 25 (+19.05%)
Mutual labels:  data-structure
10weeks-codingtest
๊ตฌ๋ฆ„EDU 10์ฃผ์™„์„ฑ ์•Œ๊ณ ๋ฆฌ์ฆ˜ ์ฝ”๋”ฉํ…Œ์ŠคํŠธ์˜ ํ•ด์„ค ๋‹ต์•ˆ์ง‘์ž…๋‹ˆ๋‹ค
Stars: โœญ 122 (+480.95%)
Mutual labels:  data-structure
js-symbol-tree
Turn any collection of objects into its own efficient tree or linked list using Symbol
Stars: โœญ 86 (+309.52%)
Mutual labels:  data-structure
nanostack
Small middleware stack library
Stars: โœญ 39 (+85.71%)
Mutual labels:  data-structure
CPTH
๐ŸŒŸ Competitive Programming Template Headers | With documentation, CI tests and Codecov
Stars: โœญ 23 (+9.52%)
Mutual labels:  data-structure
fortran-octree
A Fortran octree implementation
Stars: โœญ 17 (-19.05%)
Mutual labels:  data-structure
algorithm
ๅพ—ๅˆฐๆฏๅ‘จไธ€็ฎ—ๆณ•
Stars: โœญ 44 (+109.52%)
Mutual labels:  data-structure
SoleilNotes
ๆŠ€ๆœฏ้ข่ฏ•ๅฟ…ๅค‡็Ÿฅ่ฏ†็‚น๏ผšAndroidใ€Javaใ€Cใ€C++ใ€Pythonใ€Flutterใ€Gradleใ€ๆ•ฐๆฎ็ป“ๆž„ใ€่ฎก็ฎ—ๆœบ็ป„ๆˆๅŽŸ็†ใ€่ฎก็ฎ—ๆœบ็ฝ‘็ปœใ€ๆ“ไฝœ็ณป็ปŸใ€็ฎ—ๆณ•ใ€ๆ•ฐๆฎ็ป“ๆž„ใ€่ฎพ่ฎกๆจกๅผใ€ๅฏ†็ ๅญฆ็ญ‰็ญ‰
Stars: โœญ 483 (+2200%)
Mutual labels:  system-design
System-Design
System design and Object Oriented Design (OOD) related interview problems and solutions.
Stars: โœญ 77 (+266.67%)
Mutual labels:  system-design
js-data-structures
๐ŸŒฟ Data structures for JavaScript
Stars: โœญ 56 (+166.67%)
Mutual labels:  data-structure
system-design-in-practice
Learn how to design a system from tech company blogs ็ณป็ปŸ่ฎพ่ฎกๅšๅฎข
Stars: โœญ 133 (+533.33%)
Mutual labels:  system-design
array-keyed-map
JS datastructure, like Map, but the keys are arrays
Stars: โœญ 29 (+38.1%)
Mutual labels:  data-structure
playground
A place to play programming
Stars: โœญ 21 (+0%)
Mutual labels:  data-structure
Awesome-Software-Engineering-Interview
No description or website provided.
Stars: โœญ 409 (+1847.62%)
Mutual labels:  system-design

CS_BASICS

pic_source

Language Update Build Status PRs

Resource

Algorithms content

Database

Shell


Progress

Data Structure

# Title Solution Use case Comment Status
Queue Python , JS AGAIN*
Stack Python , JS stack (via linkedlist), JS - stack (via array) OK
LinkedList Python, JS OK**
Doubly LinkedList Python, JS AGAIN
Tree Python AGAIN**
Trie Python AGAIN
Heap Python , Java AGAIN
Max Heap Python AGAIN
Array Python AGAIN*
Graph Python , JS. Java-graph, Java-graph-client OK***
Binary search Tree (BST) Python, JS, Scala, Java AGAIN
Hash table Python, JS usually for improving time complexity B(O) via extra space complexity (time-space tradeoff) good basic AGAIN****
DirectedEdge Java AGAIN

Algorithm

# Title Solution Use case Comment Status
Binary search Python AGAIN
Linear search Python AGAIN
Breadth-first search (BFS) Python, JS FIND SHORTEST PATH AGAIN***
Depth-first search (DFS) Python, JS TO CHECK IF SOMETHING EXIST inorder, postorder, postorder (can recreate a tree) AGAIN***
Bubble sort Python, JS , C OK* (3)
Insertion sort Python, JS stable sort work very fast for nearly sorted array AGAIN
Bucket sort Python AGAIN
Quick sort Python AGAIN***
Heap sort Python AGAIN**
Merge sort Python, JS, Java, SQL OK* (2)
Pancake sort Python AGAIN
Selection sort Python, JS AGAIN
Topological sort Python Topological Sort is a algorithm can find "ordering" on an "order dependency" graph AGAIN
md5 Python AGAIN
Union Find Python 1, Python 2, Java 1 AGAIN
Dynamic programming JS 1, fibonacci_dp JS AGAIN
Dijkstra Python,Java AGAIN***
Floyd-Warshall Python not start
Bellman-Ford Python not start
Quick Find Python, Java init : O(N), union : O(N), find : O(1) simple, but slow AGAIN
Quick Union Java init : O(N), union : O(N), find : O(N) lazy approach, route compression, optimized Quick Find AGAIN
Quick Union (Improvements) lazy approach, path compression AGAIN
Priority Queue (unsorted) Java AGAIN
LRU cache Python LC 146 AGAIN
LFU Cache Python LC 460 AGAIN

Array

# Title Solution Time Space Difficulty Note Status
015 3 Sum Python O(n^2) O(1) Medium Curated Top 75, good basic, check with # 001 Two Sum, #018 4 sum, Two Pointers, good basic,amazon,fb OK******* (7)
016 3 Sum Closest Python O(n^2) O(1) Medium Two Pointers, basic, good trick,3 sum,google, fb, apple, m$, GS, amazon AGAIN**** (2)
018 4 Sum Python O(n^3) O(1) Medium k sum, Two Pointers, check #016 3 sum, # 454 4 SUM II,good trick, fb AGAIN******** (4)
026 Remove Duplicates from Sorted Array Python, Scala O(n) O(1) Easy Two Pointers, basic, good trick,M$ ,fb AGAIN*********** (9)
027 Remove Element Python, Scala O(n) O(1) Easy basic, amazon OK* (2)
031 Next Permutation Python, Scala O(n) O(1) Medium good trick, check, 2 pointers, Uber, GS, google,amazon, fb AGAIN****************** (8) (MUST)
041 First Missing Positive Python O(n) O(1) Hard good trick, hash key , array, LC top 100 like, amazon, fb, google, apple, uber AGAIN******** (2)
048 Rotate Image Python O(n^2) O(1) Medium Curated Top 75, basic, i,j->j,i transpose matrix, garena, amazon, apple AGAIN************* (5) (MUST)
054 Spiral Matrix Python O(m * n) O(1) Medium Curated Top 75, good basic, array boundary, matrix,amazon AGAIN**** (4)
057 Insert Interval Python Medium Curated Top 75, good basic, 056 Merge Intervals AGAIN********** (4) (MUST!)
059 Spiral Matrix II Python O(n^2) O(1) Medium check # 054 Spiral Matrix, amazon AGAIN** (2)
066 Plus One Python O(n) O(1) Easy basic, digit, google OK** (2)
073 Set Matrix Zeroes Python O(m * n) O(1) Medium Curated Top 75, matrix, amazon OK* (4)
080 Remove Duplicates from Sorted Array II Python O(n) O(1) Medium two pointers,AGAIN, basic, trick, fb, #26 Remove Duplicates from Sorted Array AGAIN************ (8)
118 Pascal's Triangle Python O(n^2) O(1) Easy trick, basic AGAIN** (2)
119 Pascal's Triangle II Python O(n^2) O(1) Easy array, check with # 118 Pascal's Triangle, amazon OK** (4)
121 Best Time to Buy and Sell Stock Python O(n) O(1) Easy Curated Top 75, dp,basic,greedy,UBER, M$, amazon, fb OK****** (6) (but again)
157 Read N Characters Given Read4 Python O(n) O(1) Easy ๐Ÿ”’, buffer, google, amazon, fb AGAIN**** (3)
163 Missing Ranges Python O(n) O(1) Medium two pointer, ๐Ÿ”’, google, amazon AGAIN******* (3)
169 Majority Element Python O(n) O(1) Easy amazon OK*
189 Rotate Array Python O(n) O(1) Medium array, k % len(nums), good basic, amazon OK* (7) (but again)
209 Minimum Size Subarray Sum Python O(n) O(1) Medium good basic, sliding window, Binary Search, trick,2 pointers, fb OK********** (5) (but again)
215 Kth Largest Element in an Array Python O(n) ~ O(n^2) O(1) Medium EPI, quick sort, bubble sort, sort, amazon,fb OK* (2)
228 Summary Ranges Python O(n) O(1) Easy check # 163 Missing Ranges, basic, array, google OK*** (3)
229 Majority Element II Python O(n) O(1) Medium OK
238 Product of Array Except Self Python O(n) O(1) Medium Curated Top 75, array, LintCode, good trick, Apple, M$, amazon, fb OK******* (but again)(5)
240 Search a 2D Matrix II Python O(m + n) O(1) Medium LintCode, basic, matrix, trick, binary search, check # 74 Search a 2D Matrix, amazon, apple OK***** (6) (but again)
243 Shortest Word Distance Python O(n) O(1) Easy ๐Ÿ”’, basic OK*
245 Shortest Word Distance III Python O(n) O(1) Medium ๐Ÿ”’, check Shortest Word Distance I II III OK*
251 Flatten 2D Vector Python O(1) O(1) Medium ๐Ÿ”’, good basic, check# 341 Flatten Nested List Iterator, google, airbnb, twitter, amazon AGAIN******** (4)
277 Find the Celebrity Python O(n) O(1) Medium graph, ๐Ÿ”’, fb,amazon, trick AGAIN********** (5)
287 Find the Duplicate Number Python Medium good trick,binary search, cycle linked list, check # 142 Linked List Cycle II, amazon OK* (2)
289 Game of Life Python O(m * n) O(1) Medium simultaneous,matrix,complex, google, amazon AGAIN*** (4)
293 Flip Game Python O(n * (c+1)) O(1) Easy ๐Ÿ”’, basic AGAIN*
308 Range Sum Query 2D - Mutable Python O(n * (c+1)) O(1) Hard LC 303, pre-sum, matrix, tree, ๐Ÿ”’, google not start
311 Sparse Matrix Multiplication Python O(m * n * l) O(m * l) Medium ๐Ÿ”’, matrix, basic, fb OK**** (4)
334 Increasing Triplet Subsequence Python O(n) O(1) Medium AGAIN, check # 300 Longest Increasing Subsequence, trick, fb, variables OK***** (but again) (4)
370 Range Addition Python O(k + n) O(1) Medium prefix sum, array, ๐Ÿ”’, check # 598 Range Addition II, amazon AGAIN************** (4) (MUST)
384 Shuffle an Array Python O(n) O(n) Medium EPI, trick OK*
396 Rotate Function Python O(n) O(1) Medium can pass, math, trick, amazon AGAIN*** (3)
412 Fizz Buzz Python, Scala O(n) O(1) Easy OK
414 Third Maximum Number Python O(n) O(1) Easy good basic, amazon OK* (4)
419 Battleships in a Board Python O(m * n) O(1) Medium AGAIN*
422 Valid Word Square Python O(m * n) O(1) Easy ๐Ÿ”’, basic, matrix AGAIN*
442 Find All Duplicates in an Array Python O(n) O(1) Medium OK*
448 Find All Numbers Disappeared in an Array Python O(n) O(1) Easy OK
498 Diagonal Traverse Python O(n) O(1) Medium matrix,google,fb AGAIN*** (3) (not start)
531 Lonely Pixel I Python O(m * n) O(m + n) Medium ๐Ÿ”’, matrix, basic AGAIN*
533 Lonely Pixel II Python O(m * n) O(m * n) Medium ๐Ÿ”’ AGAIN (not start*)
565 Array Nesting Python O(n) O(1) Medium union find,dfs,apple AGAIN**** (1)
566 Reshape the Matrix Python O(m * n) O(m * n) Easy basic, matrix AGAIN**
581 Shortest Unsorted Continuous Subarray Python O(n) O(1) Easy basic AGAIN*
605 Can Place Flowers Python O(n) O(1) Easy pass vs continue OK*
624 Maximum Distance in Arrays Python O(n) O(1) Easy ๐Ÿ”’ AGAIN*
643 Maximum Average Subarray I Python O(n) O(1) Easy Math, basic AGAIN*
661 Image Smoother Python O(m * n) O(1) Easy matrix,basic, amazon OK***** (4) (but again!)
665 Non-decreasing Array Python O(n) O(1) Easy AGAIN (not start)
667 Beautiful Arrangement II Python O(n) O(1) Medium AGAIN (not start)
670 Maximum Swap Python O(logn) O(logn) Medium good basic, reversed, str -> list,string + pointers , fb AGAIN************ (9) (MUST)
674 Longest Continuous Increasing Subsequence Python O(n) O(1) Easy good basic,dp,2 pointers ,array ,fb OK*** (5)
697 Degree of an Array Python O(n) O(n) Easy AGAIN (not start)
713 Subarray Product Less Than K Python O(n) O(1) Medium basic, sliding window, good trick OK****** (3) (but again)
717 1-bit and 2-bit Characters Python O(n) O(1) Easy Greedy AGAIN (not start)
723 Candy Crush Python O((R * C)^2) O(1) Medium complex AGAIN (not start)
724 Find Pivot Index Python O(n) O(1) Easy OK*
729 My Calendar I Python O(nlogn) O(n) Medium python class AGAIN* (not start)
731 My Calendar II Python O(n^2) O(n) Medium trick, basic AGAIN** (not start)
747 Largest Number At Least Twice of Others Python O(n) O(1) Easy good basic, data structure OK*
755 Pour Water Python O(v * n) O(1) Medium complex AGAIN (not start)
766 Toeplitz Matrix Python O(m * n) O(1) Easy basic, matrix, google AGAIN* (2)
769 Max Chunks To Make Sorted Python O(n) O(1) Medium AGAIN** (not start)
792 Number of Matching Subsequences Python O(n + w) O(1) Medium trick AGAIN* (not start)
794 Valid Tic-Tac-Toe State Python O(1) O(1) Medium complex AGAIN
795 Number of Subarrays with Bounded Maximum Python O(n) O(1) Medium AGAIN (not start*)
807 Max Increase to Keep City Skyline Python O(n^2) O(n) Medium AGAIN*
821 Shortest Distance to a Character Python O(n) O(1) Easy basic, trick AGAIN**
830 Positions of Large Groups Python O(n) O(1) Easy basic AGAIN*
832 Flipping an Image Python O(n^2) O(1) Easy AGAIN*
835 Image Overlap Python O(n^4) O(n^2) Medium AGAIN (not start)
840 Magic Squares In Grid Python O(m * n) O(1) Easy complex AGAIN (not start)
842 Split Array into Fibonacci Sequence Python O(n^3) O(n) Medium check # 306 Addictive Number, basic, dfs, fibonacci AGAIN* (not start)
845 Longest Mountain in Array Python O(n) O(1) Medium basic, trick AGAIN* (not start)
849 Maximize Distance to Closest Person Python O(n) O(1) Easy basic, trick AGAIN (not start*)
860 Lemonade Change Python O(n) O(1) Easy amazon OK* (2)
0868 Transpose Matrix Python O(r * c) O(1) Easy basic OK*
885 Spiral Matrix III Python O(max(m, n)^2) O(1) Medium basic AGAIN* (not start)
888 Fair Candy Swap Python O(m + n) O(m + n) Easy basic, trick OK*
896 Monotonic Array Python O(n) O(1) Easy all,array ,fb OK
905 Sort Array By Parity Python O(n) O(1) Easy sort by lambda OK
909 Snakes and Ladders Python O(n^2) O(n^2) Medium array, matrix, dfs,complex, amazon AGAIN***** (3)
915 Partition Array into Disjoint Intervals Python O(n) O(n) Medium basic, trick AGAIN* (not start)
918 Maximum Sum Circular Subarray Python O(n) O(1) Medium check # 053 Maximum Subarray, basic, trick AGAIN* (not start)
921 Minimum Add to Make Parentheses Valid Python O(n) O(1) Medium basic, trick AGAIN**
922 Sort Array By Parity II Python O(n) O(1) Easy basic AGAIN*
923 3Sum With Multiplicity Python O(n^2) O(n) Medium AGAIN (not start)
932 Beautiful Array Python O(n) O(n) Medium basic, trick AGAIN (not start)
941 Valid Mountain Array Python O(n) O(1) Easy basic, good basic AGAIN*
945 Minimum Increment to Make Array Unique Python O(nlogn) O(n) Medium trick, good AGAIN**
947 Most Stones Removed with Same Row or Column Python O(n) O(n) Medium Union Find , trick AGAIN (not start)
949 Largest Time for Given Digits Python O(1) O(1) Easy OK*
950 Reveal Cards In Increasing Order Python O(n) O(n) Medium AGAIN (not start)
954 Array of Doubled Pairs Python O(n + klogk) O(k) Medium counter, dict, trick AGAIN**
961 N-Repeated Element in Size 2N Array Python O(n) O(1) Easy OK
989 Add to Array-Form of Integer Python O(n) O(1) Easy add xxx to sum, fb AGAIN (not start)
004 Median of Two Sorted Arrays Python O(n) O(1) Hard array, heapq, binary search, amazon AGAIN* (1)
010 Regular Expression Matching Python O(n) O(1) Hard recursion, dp, fb AGAIN (not start)
056 Merge Intervals Python O(n) O(1) Medium Curated Top 75, good trick,057 Insert Interval, twitter,M$,UBER,google,amazon,fb OK********* (6) (but AGAIN)
759 Employee Free Time Python O(n) O(1) Hard LC 56 and LC 986, heap, merger intervals, scanning line, amazon, fb, google, uber, airbnb AGAIN********** (2) (not start)
1014 Best Sightseeing Pair Python Medium dp, array, good basic, Spotify AGAIN (not start)
1027 Longest Arithmetic Subsequence Python Medium dp, hash table, trick, google, amazon AGAIN*** (not start)
1041 Robot Bounded In Circle Python Medium array, math, amazon AGAIN** (2)
1109 Corporate Flight Bookings Python Medium array, amazon AGAIN (not start)
1248 Count Number of Nice Subarrays Python Medium LC 828, hash map, Prefix sum, dict, windown, good basic, deque, array, amazon AGAIN************** (3) (MUST)
1275 Find Winner on a Tic Tac Toe Game Python Easy amazon AGAIN (not start)
1567 Maximum Length of Subarray With Positive Product Python Medium good trick, array, dp, 2 pointers, amazon AGAIN**** (1) (not start)
1914 Cyclically Rotating a Grid Python Medium array, brute force, dequeueamazon AGAIN (not start)

Hash Table

# Title Solution Time Space Difficulty Status Note
001 Two Sum Python, Java,Scala O(n) O(n) Easy good basic, hash table, apple, amazon, UBER, grab, fb OK*** (6) (but again)
003 Longest Substring Without Repeating Characters Python O(n) O(1) Medium Curated Top 75, 2 pointers, optimized (SLIDING WINDOW + DICT),good trick, hashMap, sliding window, apple,amazon,fb AGAIN**************** (9) (but AGAIN)
036 Valid Sudoku Python O(9^2) O(9) Medium UBER, apple, amazon OK** (2) (again)
049 Group Anagrams Python, Scala O(n * glogg) O(n) Medium Curated Top 75, good basic, dict,trick,dict + sort, UBER, amazon, fb OK ********** (6)
170 Two Sum III - Data structure design Python O(n) O(n) Easy ๐Ÿ”’, trick,good basic, linkedin, fb OK*** (4)
187 Repeated DNA Sequences Python O(n) O(n) Medium basic,trick,set, linkedin AGAIN**
202 Happy Number Python O(k) O(k) Easy twitter,airbnb, UBER AGAIN** (3)
204 Count Primes Python O(n) O(n) Medium good trick, cache, dict, set, M$, amazon AGAIN******** (5)
205 Isomorphic Strings Python O(n) O(1) Easy basic, trick, bloomberg AGAIN**
217 Contains Duplicate Python O(n) O(n) Easy Curated Top 75, yahoo, airbnb OK
219 Contains Duplicate II Python O(n) O(n) Easy basic, trick, hash table AGAIN*
244 Shortest Word Distance II Python ctor: O(n), lookup: O(a + b) O(n) Medium ๐Ÿ”’ AGAIN (not start*)
246 Strobogrammatic Number Python O(n) O(1) Easy ๐Ÿ”’, google, fb OK* (4)
249 Group Shifted Strings Python O(nlogn) O(n) Easy ๐Ÿ”’,apple, UBER, google AGAIN* (4) (not start)
266 Palindrome Permutation Python O(n) O(1) Easy ๐Ÿ”’ OK
288 Unique Word Abbreviation Python ctor: O(n), lookup: O(1) O(k) Medium ๐Ÿ”’, ?, google AGAIN (2)(not start)
290 Word Pattern Python O(n) O(c) Easy basic, chcek # 205 Isomorphic Strings,good basic, for ptn, word in zip(pattern, words), dropbox , UBER AGAIN* (3)
299 Bulls and Cows Python O(n) O(1) Easy trick,map(operator.eq, a, b),amazon, airbnb, google AGAIN* (3)
314 Binary Tree Vertical Order Traversal Python O(n) O(n) Medium ๐Ÿ”’, BFS,DFS,hash table, tree, trick,google, amazon,fb, m$ OK**** (6)
325 Maximum Size Subarray Sum Equals k Python O(n) O(n) Medium prefix sum, ๐Ÿ”’, basic, good trick, dict, fb AGAIN************ (7) (MUST)
356 Line Reflection Python O(n) O(n) Medium ๐Ÿ”’, Hash, Two Pointers,math,google AGAIN (not start)
387 First Unique Character in a String Python O(n) O(n) Easy amazon, apple, fb OK
388 Longest Absolute File Path Python O(n) O(d) Medium stack, hash table, good trick, file system, google AGAIN******* (3)
409 Longest Palindrome Python O(n) O(1) Easy OK*
424 Longest Repeating Character Replacement Python O(n) O(1) Medium Curated Top 75, silding window, two pointers, good trick, LC blind pattern AGAIN********* (6)
438 Find All Anagrams in a String Python O(n) O(1) Medium trick, AGAIN, sliding window,acc Counter,amazon,fb, apple, google, uber, yahoo AGAIN************** (8)
447 Number of Boomerangs Python O(n^2) O(n) Easy trick, google AGAIN (3) (not start)
454 4Sum II Python O(n^2) O(n^2) Medium check LC 018 4SUM, trick, basic, amazon AGAIN**
463 Island Perimeter Python O(n) O(k) Medium basic,hash table, google, fb, amazon AGAIN** (2)
470 Implement Rand10() Using Rand7() Python O(1) O(1) Medium trick, google AGAIN** (3)
473 Matchsticks to Square Python O(n * s * 2^n) O(n * (2^n + s)) Medium complex,hard AGAIN (not start)
523 Continuous Subarray Sum Python O(n) O(k) Medium sub array sum, check # 560 Subarray Sum Equals K,good trick,substring, hash table,AGAIN,M$,fb, apple AGAIN*************** (10) (MUST)
525 Contiguous Array python O(n) O(n) Medium sub-array sum, good basic, array, hashmap, cache, AGAIN, fb, amazon AGAIN*************** (11) (MUST)
532 K-diff Pairs in an Array Python O(n) O(n) Medium hash table, basic, collections.Counter(),a-b =k -> a = k + b , amazon AGAIN********** (6)
554 Brick Wall Python O(n) O(m) Medium trick,hash map, bloomberg, fb, grab AGAIN******** (5)
560 Subarray Sum Equals K Python O(n) O(n) Medium must check,check # 523 Continuous Subarray Sum, LC 1268,basic, substring,good trick,google,fb AGAIN************** (6) (MUST)
561 Array Partition I Python O(r) O(r) Easy OK
575 Distribute Candies Python O(n) O(n) Easy OK
594 Longest Harmonious Subsequence Python O(n) O(n) Easy basic, good trick OK* (3)
599 Minimum Index Sum of Two Lists Python O((m + n) * l) O(m * l) Easy yelp OK*
609 Find Duplicate File in System Python O(n * l) O(n * l) Medium collections.defaultdict(list), dropbox OK*
657 Robot Return to Origin Python Easy amazon OK (2)
748 Shortest Completing Word Python O(n) O(1) Easy collections.Counter, hash table,google AGAIN* (3)
760 Find Anagram Mappings Python O(n) O(n) Easy basic, collections.defaultdict OK
771 Jewels and Stones Python O(m + n) O(n) Easy amazon OK (2)
811 Subdomain Visit Count Python O(n) O(n) Easy indeed, bloomberg AGAIN (not start)
822 Card Flipping Game Python O(n) O(n) Medium good basic AGAIN* (3)
825 Friends Of Appropriate Ages Python O(a^2 + n) O(a) Medium good basic,counter,AGAIN,fb AGAIN***** (5)
869 Reordered Power of 2 Python O(1) O(1) Medium trick,basic, bit manipulation, bit AGAIN*
873 Length of Longest Fibonacci Subsequence Python O(n^2) O(n) Medium trick, DP, Fibonacci, set AGAIN**
957 Prison Cells After N Days Python O(1) O(1) Medium trick, DP, mod AGAIN (not start)
966 Vowel Spellchecker Python O(n) O(w) Medium trick, dict, set AGAIN (not start)
974 Subarray Sums Divisible by K Python O(n) O(k) Medium variant of # 560 Subarray Sum Equals K , trick, basic AGAIN** (3) (not start)
992 Subarrays with K Different Integers Python O(n) O(k) Hard 2 pointers, hashmap, sliding window, amazon AGAIN (not start)
1010 Pairs of Songs With Total Durations Divisible by 60 Python Medium good basicm dict, array, amazon AGAIN********* (4) (MUST)
1099 Two Sum Less Than K Python Medium dict, sort, amazon AGAIN* (1) (not start)
1131 Rank Transform of an Array Python Easy dict, array, amazon OK* (1)
1296 Divide Array in Sets of K Consecutive Numbers Python Medium LC 846, dict, google AGAIN (not start)
1923 Longest Common Subpath python O(n) O(h) Hard hash, bit, amazon AGAIN (not start)

Linked list

# Title Solution Time Space Difficulty Note Status
002 Add Two Numbers Python O(n) O(1) Medium Curated Top 75, check # 445 Add Two Numbers II, basic, linked list, airbnb, amazon, fb OK**** (5) (but again)
021 Merge Two Sorted Lists Python O(n) O(1) Easy Curated Top 75, UBER, amazon, apple, fb OK******** (6) (but again)
023 Merge k sorted lists python O(n) O(h) Hard Curated Top 75, linked list, check #21 Merge Two Sorted Lists, amazon OK**** (2) (but again !!!
024 Swap Nodes in Pairs Python O(n) O(1) Easy GOOD basic, LC 100 like, UBER,amazon, fb AGAIN************* (5) (MUST)
025 Reverse Nodes in k-Group Python O(n) O(1) Hard good trick, reverse linkedlist, reverse K linkedlist, amazon, google, fb, m$ AGAIN********** (4)
061 Rotate List Python O(n) O(1) Medium basic AGAIN (2)
082 Remove Duplicates from Sorted List II Python O(n) O(1) Medium check # 083 Remove Duplicates from Sorted List AGAIN (2)
083 Remove Duplicates from Sorted List Python O(n) O(1) Easy basic OK*
092 Reverse Linked List II Python O(n) O(1) Medium # 206 Reverse Linked List, good trick, fb, apple, google, amazon, m$ AGAIN*********** (5 (MUST)
138 Copy List with Random Pointer Python O(n) O(1) Medium trick, linked list,hash table,UBER, M$, amazon, fb AGAIN***** (6)
160 Intersection of Two Linked Lists Python O(m + n) O(1) Easy basic, airbnb, amazon,fb OK******* (6) (again!)
203 Remove Linked List Elements Python O(n) O(1) Easy linked list basic,amazon AGAIN** (2)
206 Reverse Linked List Python O(n) O(1) Easy Curated Top 75, good basic,amazon,fb OK*********** (9) (MUST again)
234 Palindrome Linked List Python O(n) O(1) Easy linked list,amazon,fb OK (4)
237 Delete Node in a Linked List Python O(1) O(1) Easy LintCode, apple OK * (1) (but again)
328 Odd Even Linked List Python O(n) O(1) Medium basic OK** (2)
369 Plus One Linked List Python O(n) O(1) Medium ๐Ÿ”’, basic, trick AGAIN* (2)
445 Add Two Numbers II Python O(m + n) O(m + n) Medium trick, linked list, string,good basic, amazon AGAIN*** (3)
725 Split Linked List in Parts Python O(n + k) O(1) Medium mod, split linked list, linked list, good trick,amazon AGAIN************ (6) (again)
817 Linked List Components Python O(m + n) O(m) Medium OK*
430 Flatten a Multilevel Doubly Linked List Python Medium good trick,doubly linked list,AGAIN,dfs, fb AGAIN********* (4)
708 Insert into a Cyclic Sorted List python O(n) O(h) Medium AGAIN,cyclic linked list,good trick, google, amazon, fb AGAIN******** (4)

Stack

# Title Solution Time Space Difficulty Note Status
020 Valid Parentheses Python O(n) O(n) Easy Curated Top 75, good basic,fb, amazon OK** (6)
032 Longest Valid Parentheses Python O(n) O(n) Hard brute force, dp, stackm deque, LC top 100 likes, amazon, fb, m$ AGAIN***** (1) (not start)
071 Simplify Path Python O(n) O(n) Medium basic, stack, amazon,fb OK** (5)
085 Maximal Rectangle Python O(n) O(n) Hard top-100-like, brute force, stack, dp, LC 084, google, amazon, apple AGAIN (not start)
101 Symmetric Tree Python O(n) O(h) Easy good basic,bfs, dfs, linkedin, M$,amazon, fb, google AGAIN********** (4)
150 Evaluate Reverse Polish Notation Python O(n) O(n) Medium stack, good trick,amazon AGAIN******* (4)
155 Min Stack Python O(n) O(1) Easy basic, stack, data structure, amazon OK******* (4)
173 Binary Search Tree Iterator python O(1) O(h) Medium good basic,tree, stack, M$, linkedin, google,amazon,fb OK***** (5)
224 Basic Calculator python O(n) O(n) Hard basic,trick,stack, LC 227, amazon AGAIN******* (3)
227 Basic Calculator II python O(n) O(n) Medium delay op, LC 224, good trick,stack,airbnb ,fb, amazon AGAIN************** (6) (MUST)
232 Implement Queue using Stacks python O(1), amortized O(n) Easy stack, stack-queue, EPI, LintCode, amazon OK** (2)
255 Verify Preorder Sequence in Binary Search Tree python O(n) O(1) Medium ๐Ÿ”’ AGAIN (not start)
331 Verify Preorder Serialization of a Binary Tree python O(n) O(1) Medium AGAIN (not start)
341 Flatten Nested List Iterator python O(n) O(h) Medium LC 284, ๐Ÿ”’ Iterator, stack, generator, good basic,amazon,fb*** AGAIN********* (6)
385 Mini Parser python O(n) O(h) Medium AGAIN
394 Decode String python O(n) O(h) Medium stack, good basic!!!!, pre num string, LC 224, LC 227, amazon, google AGAIN************** (6) (MUST)
439 Ternary Expression Parser python O(n) O(1) Medium ๐Ÿ”’ AGAIN (not start)
456 132 Pattern python O(n) O(n) Medium AGAIN (not start)
496 Next Greater Element I python O(n) O(n) Easy good basic, stack, LC 739, LC 503, LC 406 OK****** (3) (but again)
503 Next Greater Element II python O(n) O(n) Medium good basic, stack, LC 739, LC 503, LC 406 AGAIN************* (7)
636 Exclusive Time of Functions python O(n) O(n) Medium trick,AGAIN,stack,UBER, fb AGAIN********** (4)
682 Baseball Game python O(n) O(n) Easy good basic, stack,amazon OK* (3)
735 Asteroid Collision python O(n) O(n) Medium good basic, stack, m$, GS, fb, amazon AGAIN************** (5)
739 Daily Temperatures python O(n) O(n) Medium LC 739, LC 503, LC 406, AGAIN, stack, good trick,amazon AGAIN******************* (9) (MUST)
772 Basic Calculator III python O(n) O(n) Medium check LC 224, 227 AGAIN (not start)
853 Car Fleet python O(nlogn) O(n) Medium AGAIN (not start)
856 Score of Parentheses python O(n) O(1) Medium AGAIN (not start)
872 Leaf-Similar Trees python O(n) O(h) Easy AGAIN*
895 Maximum Frequency Stack python O(n) O(h) Hard good basic, heap, design, stack, amazon, apple, linkedin, m$, twitter AGAIN********** (1) (not start)
901 Online Stock Span python O(n) O(n) Medium AGAIN (not start)
946 Validate Stack Sequences python O(n) O(n) Medium AGAIN
1047 Remove All Adjacent Duplicates in String python O(n) O(n) easy good basic, fb, amazon, google AGAIN************ (3) (MUST)
1209 Remove All Adjacent Duplicates in String II python O(n) O(n) Medium good basic, stack, two pointers, greedy, fb, amamzon, apple, spotify AGAIN************ (3) (MUST)
1703 Minimum Adjacent Swaps for K Consecutive Ones python O(n) O(n) Hard heap, sliding window, amazon AGAIN (not start)
1896 Minimum Cost to Change the Final Value of Expression python O(n) O(n) Hard complex, stack, dp, dp+stack, dfs, amazon AGAIN (not start)

Tree

# Title Solution Time Space Difficulty Note Status
094 Binary Tree Inorder Traversal python O(n) O(1) Medium good basic,Morris Traversal, M$, fb AGAIN**** (3)
124 Binary Tree Maximum Path Sum python O(n) O(1) Hard Curated Top 75, google, amazon, fb, m$, twitter AGAIN******* (2)
144 Binary Tree Preorder Traversal python O(n) O(1) Medium Morris Traversal AGAIN
208 Implement Trie (Prefix Tree) python O(n) O(1) Medium Curated Top 75, dict tree, trie, amazon,fb AGAIN************** (6) (MUST)
211 Add and Search Word - Data structure design python O(min(n, h)) O(min(n, h)) Medium Curated Top 75, Trie, DFS, do # 208 first,amazon ,fb AGAIN***** (5)
226 Invert Binary Tree python O(n) O(h), O(w) Easy Curated Top 75, good basic OK******* (4) (but again)
307 Range Sum Query - Mutable python ctor: O(n), update: O(logn), query: O(logn) O(n) Medium LintCode, DFS, Segment Tree, BIT, check #303 Range Sum Query - Immutable AGAIN* (2)(not start)
536 Construct Binary Tree from String python, java O(n) O(h) Medium ๐Ÿ”’, tree, recursive, trick, check # 606 Construct String from Binary Tree, amazon AGAIN******** (5)
538 Convert BST to Greater Tree python O(n) O(h) Medium good basic, dfs, bfs, tree, amazon OK********* (6) (but again!)
543 Diameter of Binary Tree python O(n) O(h) Easy trick,google,amazon,fb AGAIN**** (2)
545 Boundary of Binary Tree python O(n) O(h) Medium recursive, dfs, tree boundary, tree,๐Ÿ”’, good trick, amazon AGAIN********* (6)
548 Split Array with Equal Sum python O(n^2) O(n) Medium ๐Ÿ”’, good trick, array AGAIN*** (2)
563 Binary Tree Tilt python O(n) O(n) Easy AGAIN
572 Subtree of Another Tree python O(m * n) O(h) Easy Curated Top 75, LC 100, tree,good basic, dfs, bfs amazon,fb
606 Construct String from Binary Tree python O(n) O(h) Easy good basic, tree, dfs, LC # 536, amazon OK******** (7) (again!)
617 Merge Two Binary Trees python O(n) O(h) Easy tree, dfs, bfs, good basic, amazon OK******* (4) (but again)
623 Add One Row to Tree python O(n) O(h) Medium good basic, dfs, bfs AGAIN** (2)
637 Average of Levels in Binary Tree python O(n) O(h) Easy bfs, dfs, good basic, fb OK* (3)
652 Find Duplicate Subtrees python O(n) O(n) Medium AGAIN, good basic,dfs, Hash, amazon AGAIN************** (6)
653 Two Sum IV - Input is a BST python O(n) O(h) Easy Two Pointers,2 sum,bfs, dfs,amazon,fb OK*** (3)
654 Maximum Binary Tree python O(n) O(n) Medium LintCode, Descending Stack, good basic AGAIN* (2)
655 Print Binary Tree python O(n) O(h) Medium AGAIN* (2) (not start)
662 Maximum Width of Binary Tree python O(n) O(h) Medium width of tree, bfs, dfs, trick, amazon AGAIN********* (5)
663 Equal Tree Partition python O(n) O(n) Medium # LC 508, AGAIN, ๐Ÿ”’ , Hash, tree, dfs ,trick, good trick, amazon OK******** (8)
677 Map Sum Pairs python O(n) O(t) Medium Trie, trick, hard AGAIN* (2) (not start)
684 Redundant Connection python O(n) O(n) Medium Union Find, trick, basic AGAIN** (2) (not start)
687 Longest Univalue Path python O(n) O(h) Easy basic, dfs, tree, trick, google AGAIN** (3)
814 Binary Tree Pruning python O(n) O(h) Medium DFS, basic AGAIN* (2)
863 All Nodes Distance K in Binary Tree python O(n) O(n) Medium LC 752, tree, DFS + BFS, trick, hard, amazon AGAIN************ (4)
866 Smallest Subtree with all the Deepest Nodes python O(n) O(h) Medium DFS, trick, basic AGAIN** (2)
889 Construct Binary Tree from Preorder and Postorder Traversal python O(n) O(h) Medium DFS, stack, trick AGAIN** (2) (not start*)
897 Increasing Order Search Tree python O(n) O(h) Easy DFS, good basic,inorder AGAIN** (2)
919 Complete Binary Tree Inserter python ctor: O(n)
insert: O(1)
get_root: O(1)
O(n) Medium bst AGAIN** (2)
938 Range Sum of BST python O(n) O(h) Medium DFS, check # 108 Convert Sorted Array to Binary Search Tree AGAIN* (2)
951 Flip Equivalent Binary Trees python O(n) O(h) Medium DFS AGAIN* (2)
958 Check Completeness of a Binary Tree python O(n) O(w) Medium BFS, DFS, basic AGAIN** (2)
965 Univalued Binary Tree python O(n) O(h) Easy DFS, BFS, good basic AGAIN** (2)
971 Flip Binary Tree To Match Preorder Traversal python O(n) O(h) Medium DFS, trick AGAIN** (2) (not start)
979 Distribute Coins in Binary Tree python O(n) O(h) Medium DFS, trick AGAIN*** (2)
508 Most Frequent Subtree Sum python Medium tree, dfs, bfs, good basic,amazon OK*********** (4) (but again MUST)
297 Serialize and Deserialize Binary Tree python Hard Curated Top 75, tree, binary tree, DFS, check #449 Serialize and Deserialize BST ,amazon AGAIN********** (4) (MUST)
683 K Empty Slots python Hard BST, tree, bucket, google not start
701 Insert into a Binary Search Tree python Medium good basic, BST, tree, BFS, DFS OK*** (2)
1339 Maximum Product of Splitted Binary Tree python Medium dfs, tree, amazon AGAIN*** (1) (not start)
1372 Longest ZigZag Path in a Binary Tree python Medium dfs, bfs, post order, good trick, tree, amazon AGAIN*** (1) (not start)

Heap

# Title Solution Time Space Difficulty Note Status
264 Ugly Number II python O(n) O(1) Medium good trick, LC 263, LC 313, Heap, LintCode , DP, M$ AGAIN*********** (4) (MUST)
313 Super Ugly Number python O(n * k) O(n + k) Medium BST, Heap AGAIN (not start*)
373 Find K Pairs with Smallest Sums python O(k * log(min(n, m, k))) O(min(n, m, k)) Medium AGAIN (not start)
378 Kth Smallest Element in a Sorted Matrix python O(k * log(min(n, m, k))) O(min(n, m, k)) Medium LintCode AGAIN (not start)
846 Hand of Straights python O(nlogn) O(n) Medium LC 1296, google, hashmap OK*
855 Exam Room python seat: O(logn)
leave: O(logn)
O(n) Medium BST, Hash, trick AGAIN* (2) (not start)
295 Find Median from Data Stream python Hard Curated Top 75, priority queue, trick ,heap, stream, amazon AGAIN****** (6)
703 Kth Largest Element in a Stream python Easy heap, stream, amazon AGAIN***** (4)
1130 Minimum Cost Tree From Leaf Values Python Medium LC 1167,heap not start
1167 Minimum Cost to Connect Sticks Python Medium LC 1130, good basic,heap,amazon AGAIN***** (3)
1353 Maximum Number of Events That Can Be Attended Python Medium LC 252, 253, good trick, meeting room, heap, greedy, brute force, PRIORITY QUEUE, dp, bit, fb, twitter, amazon AGAIN********* (2) MUST
1481 Least Number of Unique Integers after K Removals Python Medium good trick, greedy, Counter, dict, heap,amazon AGAIN******** (3)

Bit Manipulation

# Title Solution Time Space Difficulty Note Status
136 Single Number Python O(n) O(1) Easy airbnb,amazon,fb OK
137 Single Number II Python O(n) O(1) Medium OK
190 Reverse Bits Python O(1) O(1) Easy Curated Top 75, bit, apple AGAIN*** (2)
191 Number of 1 Bits Python O(1) O(1) Easy Curated Top 75, apple OK*
201 Bitwise AND of Numbers Range Python O(1) O(1) Medium AGAIN (not start)
231 Power of Two Python O(1) O(1) Easy good basic, Bit Manipulation ,amazon OK*** (3)
260 Single Number III Python O(n) O(1) Medium xor, ^=, ^ AGAIN*
268 Missing Number Python O(n) O(1) Medium Curated Top 75, xor,amazon,fb OK* (2)
318 Maximum Product of Word Lengths Python O(n) ~ O(n^2) O(n) Medium Bit Manipulation, Counting Sort, Pruning AGAIN (not start)
342 Power of Four Python O(1) O(1) Easy power of num OK*
371 Sum of Two Integers Python O(1) O(1) Medium Curated Top 75, good basic, fb AGAIN********* (5) (bit op not start)
389 Find the Difference Python O(n) O(1) Easy amazon OK (2)
393 UTF-8 Validation Python O(n) O(1) Medium utf-8 encoding, google, fb AGAIN**** (not start*) (5)
401 Binary Watch Python O(1) O(1) Easy OK*
421 Maximum XOR of Two Numbers in an Array Python O(n) O(n) Medium AGAIN (not start)
461 Hamming Distance Python O(1) O(1) Easy fb OK* (2)
462 Minimum Moves to Equal Array Elements II Python O(n) on average O(1) Medium AGAIN*
477 Total Hamming Distance Python O(n) O(1) Medium bit manipulation, fb AGAIN****** (not start*) (4)
645 Set Mismatch Python O(n) O(1) Easy amazon OK* (3)
693 Binary Number with Alternating Bits Python O(1) O(1) Easy trick AGAIN*
762 Prime Number of Set Bits in Binary Representation Python O(1) O(1) Easy basic,Bit_Manipulation, prime number, amazon OK* (4)
868 Binary Gap Python O(1) O(1) Easy trick, linear scan AGAIN*
898 Bitwise ORs of Subarrays Python O(n) O(1) Medium AGAIN (not start)
1573 Number of Ways to Split a String Python O(n) O(1) Medium amazon, binary AGAIN** (not start)
1915 Number of Wonderful Substrings Python O(n) O(1) Medium bit mask, bit, prefix sum, dp, amazon AGAIN*** (2) (not start)

String

# Title Solution Time Space Difficulty Status, Note Status
005 Longest Palindromic Substring python O(n) O(n) Medium Curated Top 75, LC 647, good trick, 2 pointer, recursive, Manacher's Algorithm, LC 100 like, DP, UBER, amazon, fb AGAIN************** (8)(MUST)
006 ZigZag Conversion python O(n) O(1) Easy AGAIN (not start)
008 String to Integer (atoi) python O(n) O(1) Medium string op, regular expression,UBER, amazon, fb AGAIN***** (5)
014 Longest Common Prefix python O(n * k) O(1) Easy good basic OK*
028 Implement strStr() python O(n + k) O(k) Easy KMP Algorithm, fb OK (3)
038 Count and Say python O(n * 2^n) O(2^n) Easy recursion, iteration, basic, fb AGAIN*********** (5)
043 Multiply Strings python O(m * n) O(m + n) Medium twitter, fb AGAIN*** (3)
058 Length of Last Word python O(n) O(1) Easy OK
067 Add Binary python O(n) O(1) Easy bit op, good basic, fb, amazon OK***** (6) (but again)
076 Minimum Window Substring python Hard Curated Top 75 AGAIN******* (2) (not start)
125 Valid Palindrome python O(n) O(1) Easy Curated Top 75, LC 680, amazon,fb OK
151 Reverse Words in a String python O(n) O(1) Medium amazon,fb OK (2)
161 One Edit Distance python O(m + n) O(1) Medium ๐Ÿ”’, trick, recursion, string, , fb AGAIN ******** (6)(AGAIN)
165 Compare Version Numbers python O(n) O(1) Medium good basic, string,amazon, apple OK** (5)
186 Reverse Words in a String II python O(n) O(1) Medium LC 151, LC 557, ๐Ÿ”’, M$,UBER, amazon AGAIN* (3)
242 Valid Anagram python O(n) O(1) Easy Curated Top 75, LintCode,amazon,fb OK
271 Encode and Decode Strings python O(n) O(1) Medium Curated Top 75, decode-encode, design, check # 394 Decode String ,๐Ÿ”’, google AGAIN** (2)
306 Addictive Number python O(n^3) O(n) Medium AGAIN (not start*)
340 Longest Substring with At Most K Distinct Characters python O(n^3) O(n) Hard string, sliding window, google not start
383 Ransom Note python O(n) O(1) Easy EPI, apple OK*
405 Convert a Number to Hexadecimal python O(n) O(1) Easy basics decimal -> Hexadecimal AGAIN
408 Valid Word Abbreviation python O(n) O(1) Easy ๐Ÿ”’ AGAIN (not start)
415 Add Strings python O(n) O(1) Easy good basic, add xxx to sum, Airbnb, google, fb OK****** (4)
434 Number of Segments in a String python O(n) O(1) Easy OK
443 String Compression python O(n) O(1) Easy shoptify, basics AGAIN**
459 Repeated Substring Pattern python O(n) O(n) Easy good basic, string, KMP Algorithm, amazon OK*** (6)
468 Validate IP Address python O(1) O(1) Medium ip basic,string,twitter, fb, amazon AGAIN****** (5)
482 License Key Formatting python O(n) O(1) Easy string, basic, google OK** (3) (again)
520 Detect Capital python O(l) O(1) Easy OK
521 Longest Uncommon Subsequence I python O(min(a, b)) O(1) Easy OK*
522 Longest Uncommon Subsequence II python O(l * n^2) O(1) Medium Sort AGAIN (not start)
524 Longest Word in Dictionary through Deleting python O((d * l) * logd) O(1) Medium Sort, google AGAIN (not start)
539 Minimum Time Difference python O(nlogn) O(n) Medium basic, map & zip trick AGAIN**
541 Reverse String II python O(n) O(1) Easy AGAIN*
551 Student Attendance Record I python O(n) O(1) Easy OK
556 Next Greater Element III python O(1) O(1) Medium AGAIN (not start)
557 Reverse Words in a String III python O(n) O(1) Easy OK
616 Add Bold Tag in String python O(n * d * l) O(n) Medium ๐Ÿ”’, google AGAIN (not start)
647 Palindromic Substrings python O(n) O(n) Medium Curated Top 75, LC 005, greedy, DP, expand from center, 2 pointers, good basic,Manacher's Algorithm, Linkedin,amazon,fb OK******* (7) (MUST)
648 Replace Words python O(n) O(t) Medium Trie, good basic OK*
657 Judge Route Circle python O(n) O(1) Easy OK
678 Valid Parenthesis String python O(n) O(1) Medium AGAIN**
680 Valid Palindrome II python O(n) O(1) Easy LC 125, two pointers, good basic, Palindrome, string, fb AGAIN******** (3)
681 Next Closest Time python O(1) O(1) Medium subset of set, <=,strptime, google,fb OK*** (5)
686 Repeated String Match python O(n + m) O(1) Medium brute force, string, string match, Rabin-Karp Algorithm, google AGAIN**** (3)
696 Count Binary Substrings python O(n) O(1) Easy good trick, linear scan, group sub-string, amazon AGAIN******* (3) (MUST)
720 Longest Word in Dictionary python O(n) O(t) Easy Trie AGAIN (not start)
722 Remove Comments python O(n) O(k) Medium AGAIN (not start)
751 IP to CIDR python O(n) O(1) Medium ip AGAIN (not start*)
758 Bold Words in String python O(n * l) O(t) Easy ๐Ÿ”’, variant of Add Bold Tag in String AGAIN (not start)
791 Custom Sort String python O(n) O(1) Medium good basic, sort, counter, amazon, fb AGAIN************ (7) (MUST)
796 Rotate String python O(n) O(1) Easy good basic, KMP Algorithm, Rabin-Karp Algorithm,amazon OK**** (2)(but again)
804 Unique Morse Code Words python O(n) O(n) Easy OK*
806 Number of Lines To Write String python O(n) O(1) Easy OK*
809 Expressive Words python O(n + s) O(l + s) Medium AGAIN (not start)
816 Ambiguous Coordinates python O(n^4) O(n) Medium AGAIN (not start*)
819 Most Common Word python O(m + n) O(m + n) Easy regular expression, amazon OK** (2)
820 Short Encoding of Words python O(n) O(t) Medium Trie AGAIN (not start)
824 Goat Latin python O(n + w^2) O(l) Easy string basic, fb OK
828 Count Unique Characters of All Substrings of a Given String python O(n + w^2) O(l) Hard LC 1248, dp, string, amazon AGAIN*** (2)
831 Masking Personal Information python O(1) O(1) Medium regular expression OK*
833 Find And Replace in String python O(n + m) O(n) Medium Union Find AGAIN (not start)
848 Shifting Letters python O(n) O(1) Medium remainder, basic AGAIN**
859 Buddy Strings python O(n) O(1) Easy AGAIN*
880 Decoded String at Index python O(n) O(1) Medium trick AGAIN (not start**)
884 Uncommon Words from Two Sentences python O(m + n) O(m + n) Easy collections Counter, trick OK*
890 Find and Replace Pattern python O(n * l) O(1) Medium AGAIN (not start)
893 Groups of Special-Equivalent Strings python O(n * l) O(n) Easy AGAIN*
916 Word Subsets python O(m + n) O(1) Medium AGAIN (not start)
917 Reverse Only Letters python O(n) O(1) Easy basic,stack,pointer OK*
925 Long Pressed Name python O(n) O(1) Easy two pointer, basic, trick AGAIN*
929 Unique Email Addresses python O(n * l) O(n * l) Easy OK
939 Minimum Area Rectangle python O(n^1.5) on average O(n) Medium OK*
942 DI String Match python O(n) O(1) Easy AGAIN (not start)
944 Delete Columns to Make Sorted python O(n * l) O(1) Medium AGAIN (not start)
953 Verifying an Alien Dictionary python O(n * l) O(1) Easy AGAIN (not start)
955 Delete Columns to Make Sorted II python O(n * l) O(n) Medium AGAIN (not start)
1119 Remove Vowels from a String python O(n * l) O(n) Easy amazon OK

Queue

# Title Solution Time Space Difficulty Tag Note
281 Zigzag Iterator Python O(n) O(k) Medium good basic, queue, ๐Ÿ”’, google,fb AGAIN******* (5)
346 Moving Average from Data Stream Python O(1) O(w) Easy ๐Ÿ”’, queue, google, fb OK** (6)
933 Number of Recent Calls Python O(1) on average O(w) Easy AGAIN**
622 Design Circular Queue Python Medium good basic, array, linked list, design, circular queue,amazon,fb, apple, airbnb, m$ AGAIN************ (3) (MUST)
239 Sliding Window Maximum Python Hard sliding window, heap, deque, queue,amazon, google AGAIN********* (4)

Math

# Title Solution Time Space Difficulty Note Status
007 Reverse Integer Python O(1) O(1) Medium 0x7FFFFFFF, amazon, apple OK* (3)
009 Palindrome Number Python O(1) O(1) Easy amazon OK
012 Integer to Roman Python O(n) O(1) Medium math basic,twitter, fb, amazon, math AGAIN****** (4)
013 Roman to Integer Python O(n) O(1) Easy UBER,amazon, fb AGAIN***** (4)
029 Divide Two Integers Python O(1) O(1) Medium binary search,trick,fb AGAIN***** (3)
050 Pow(x, n) Python O(1) O(1) Medium good trick,amazon, fb, recursion AGAIN****** (4)
060 Permutation Sequence Python O(n^2) O(n) Medium Cantor Ordering,trick ,amazon AGAIN*** (2)
089 Gray Code Python O(2^n) O(1) Medium bit op, math, amazon AGAIN ********** (6)
166 Fraction to Recurring Decimal Python O(logn) O(1) Medium AGAIN (not start)
168 Excel Sheet Column Title Python O(logn) O(1) Easy trick, residual, math, AGAIN,fb AGAIN****** (5)
171 Excel Sheet Column Number Python O(n) O(1) Easy AGAIN (not start)
172 Factorial Trailing Zeroes Python O(1) O(1) Easy basic, iteration, recursion AGAIN* (2)
223 Rectangle Area Python O(1) O(1) Easy AGAIN
258 Add Digits Python O(1) O(1) Easy AGAIN
263 Ugly Number Python O(1) O(1) Easy math OK* (2)
273 Integer to English Words Python O(1) O(1) Hard amazon, passed not start
292 Nim Game Python O(1) O(1) Easy LintCode OK*
319 Bulb Switcher Python O(1) O(1) Medium AGAIN
326 Power of Three Python O(1) O(1) Easy OK
338 Counting Bits Python O(n) O(n) Medium Curated Top 75 OK*
343 Integer Break Python O(logn) O(1) Medium trick, DP AGAIN* (2)
365 Water and Jug Problem Python O(logn) O(1) Medium Bรฉzout's identity AGAIN (not start)
372 Super Pow Python O(n) O(1) Medium AGAIN
382 Linked List Random Node Python O(n) O(1) Medium Reservoir Sampling AGAIN (not start)
386 Lexicographical Numbers Python O(n) O(1) Medium AGAIN (not start)
390 Elimination Game Python O(logn) O(1) Medium AGAIN (not start)
398 Random Pick Index Python O(n) O(1) Medium Reservoir Sampling , fb OK* (4)
400 Nth Digit Python O(logn) O(1) Easy AGAIN
413 Arithmetic Slices Python O(n) O(1) Medium sliding window, amazon OK*** (1) (but again)
423 Reconstruct Original Digits from English Python O(n) O(1) Medium GCJ2016 - Round 1B AGAIN (not start)
441 Arranging Coins Python O(nlogn) O(1) Easy Binary Search OK
453 Minimum Moves to Equal Array Elements Python O(n) O(1) Easy AGAIN
458 Poor Pigs Python O(n) O(1) Easy AGAIN
469 Convex Polygon Python O(n) O(1) Medium ๐Ÿ”’ AGAIN (not start)
470 Implement Rand10() Using Rand7() Python O(1) O(1) Medium AGAIN (not start)
478 Generate Random Point in a Circle Python O(1) O(1) Medium AGAIN (not start)
497 Random Point in Non-overlapping Rectangles Python ctor: O(n)
pick: O(logn)
O(n) Medium AGAIN (not start)
504 Base 7 Python binary, math, good basic O(n) Easy AGAIN******** (1)
519 Random Flip Matrix Python ctor: O(1)
pick: O(1) reset: O(n)
O(n) Medium AGAIN (not start)
528 Random Pick with Weight Python ctor: O(n)
pick: O(logn)
O(n) Medium AGAIN (not start)
537 Complex Number Multiplication Python O(1) O(1) Medium math, amazon OK (3)
553 Optimal Division Python O(n) O(1) Medium string, math, amazon OK* (4)
573 Squirrel Simulation Python O(n) O(1) Medium ๐Ÿ”’ AGAIN (not start)
592 Fraction Addition and Subtraction Python O(nlogx) O(n) Medium AGAIN
593 Valid Square Python O(1) O(1) Medium AGAIN
598 Range Addition II Python O(p) O(1) Easy AGAIN
625 Minimum Factorization Python O(loga) O(1) Medium ๐Ÿ”’ OK*
628 Maximum Product of Three Numbers Python O(n) O(1) Easy amazon OK (2)
633 Sum of Square Numbers Python O(sqrt(c) * logc) O(1) Easy OK*
634 Find the Derangement of An Array Python O(n) O(1) Medium ๐Ÿ”’ AGAIN (not start)
640 Solve the Equation Python O(n) O(n) Medium math, regular expression, amazon AGAIN*** (3)
651 4 Keys Keyboard Python O(1) O(1) Medium ๐Ÿ”’, Math, DP AGAIN (not start)
672 Bulb Switcher II Python O(1) O(1) Medium AGAIN (not start)
728 Self Dividing Numbers Python O(n) O(1) Medium AGAIN
754 Reach a Number Python O(logn) O(1) Medium OK*
775 Global and Local Inversions Python O(n) O(1) Medium trick, math, string, amazon AGAIN** (not start) (3)
779 K-th Symbol in Grammar Python O(1) O(1) Medium math, brute force, binary, recursion, FB, amazon AGAIN*** (1)
781 Rabbits in Forest Python O(n) O(n) Medium AGAIN (not start)
789 Escape The Ghosts Python O(n) O(1) Medium AGAIN
800 Similar RGB Color Python O(1) O(1) Easy ๐Ÿ”’ AGAIN (not start)
812 Largest Triangle Area Python O(n^3) O(1) Easy AGAIN (not start)
829 Consecutive Numbers Sum Python O(sqrt(n)) O(1) Medium AGAIN
836 Rectangle Overlap Python O(1) O(1) Easy similar as 223. Rectangle Area, amazon AGAIN (2)
858 Mirror Reflection Python O(1) O(1) Medium AGAIN (not start)
867 Prime Palindrome Python O(n^(1/2) * (logn + n^(1/2))) O(logn) Medium AGAIN***
883 Projection Area of 3D Shapes Python O(n^2) O(1) Easy AGAIN
891 Sum of Subsequence Widths Python O(n^2) O(1) Hard amazon AGAIN (not start)
907 Sum of Subarray Minimums Python O(n) O(n) Medium trick, LC 084, LC 2104, Ascending Stack, amazon AGAIN**** (1)
908 Smallest Range I Python O(n) O(1) Easy OK* (2)
910 Smallest Range II Python O(nlogn) O(1) Medium AGAIN (not start)
914 X of a Kind in a Deck of Cards Python O(n * (logn)^2) O(n) Easy AGAIN (not start)
963 Minimum Area Rectangle II Python O(n^2) ~ O(n^3) O(n^2) Medium AGAIN (not start)
970 Powerful Integers Python O((logn)^2) O(r) Easy basic AGAIN* (2)
517 Super Washing Machines Python Hard amazon AGAIN (not start)
1342 Number of Steps to Reduce a Number to Zero Python easy gra* ok
1492 The kth Factor of n Python Medium amazon AGAIN (not start)
1979 Find Greatest Common Divisor of Array Python Easy GCD not start

Sort

# Title Solution Time Space Difficulty Note Status
075 Sort Colors Python O(n) O(1) Medium sorting, Tri Partition,two pointers, M$, fb OK** (4)
088 Merge Sorted Array Python O(n) O(1) Easy good basic, merge, sort,two pointers, M$, amazon,fb AGAIN************* (7) (MUST)
128 Longest Consecutive Sequence Python Medium Curated Top 75, 2 pointers, sort, sliding window, amazon AGAIN*********** (4) (MUST)
147 Insertion Sort List Python O(n^2) O(1) Medium trick AGAIN* (2)
148 Sort List Python O(nlogn) O(logn) Medium basic, check # 21 Merge Two Sorted Lists AGAIN** (2)
179 Largest Number Python O(nlogn) O(1) Medium good basic, sort with lambda,amazon AGAIN************ (3)
252 Meeting Rooms Python O(nlogn) O(n) Easy Curated Top 75, ๐Ÿ”’,UBER,amazon, fb OK*** (3) (but again)
253 Meeting Rooms II Python O(nlogn) O(n) Medium Curated Top 75, ๐Ÿ”’, sort, priority queue (min-heap),scanning line, trick,booking.com,good,UBER, amazon,google,fb AGAIN************ (5) (MUST)
274 H-Index Python O(n) O(n) Medium Counting Sort,good trick, fb AGAIN***** (3)
280 Wiggle Sort Python O(n) O(1) Medium ๐Ÿ”’,google,fb OK*** (3)
324 Wiggle Sort II Python O(n) on average O(1) Medium variant of Sort Colors , Tri Partition, google AGAIN** (2)
347 Top K Frequent Elements Python O(n) O(n) Medium Curated Top 75, Quick Select, Heap, Bucket Sort,Yelp,amazon,fb OK* (3)
406 Queue Reconstruction by Height Python O(n * sqrt(n)) O(n) Medium basic,trick, sort by key, insert, google AGAIN********* (5)
451 Sort Characters By Frequency Python O(n) O(n) Medium collections.Counter(s).most_common,sorted(count_dict.items() with lambda,good basic, amazon OK* (4)
692 Top K Frequent Words Python O(n + klogk) on average O(n) Medium good basic,Quick Select, Heap, Bucket Sort, heapq, yelp, UBER,amazon,fb OK***** (5)
937 Reorder Data in Log Files Python O(nlogn * l) O(l) Easy good basic, sort, string, amazon OK**** (3)(again!!!)
969 Pancake Sorting Python O(n^2) O(l) Medium fb, sorting AGAIN********** (4)
973 K Closest Points to Origin Python O(n) on average O(1) Medium sort with lambda, Quick Select, Heap, amazon OK* (3)
976 Largest Perimeter Triangle Python O(nlogn) O(1) Easy OK*
1152 Analyze User Website Visit Pattern Python O(nlogn) O(1) Medium itertools.combinations, sort, brute force, set, amazon AGAIN***** (2) (not start)
2021 Brightest Position on Street Python O(nlogn) O(1) Medium LC 253 meeting room II, priority queue (min-heap), scanning line, trick, amazon AGAIN*********** (3) (MUST)

Two Pointers

# Title Solution Time Space Difficulty Note Status
019 Remove Nth Node From End of List Python O(n) O(1) Medium Curated Top 75, good basic, linked list,two pointers,fb AGAIN********** (4) (MUST)
042 Trapping Rain Water Python Hard scan, dp, trick, two pointer, amazon, apple AGAIN*** (2) (not start)
086 Partition List Python O(n) O(1) Medium OK*
141 Linked List Cycle Python O(n) O(1) Easy Curated Top 75, basic,amazon, fb, linked list, 2 pointers, check #142 OK** (5)
142 Linked List Cycle II Python O(n) O(1) Medium linked list, 2 pointers, check #141 AGAIN****** (4) (again!)
143 Reorder List Python O(n) O(1) Medium Curated Top 75, LC 021, 206, 876, good trick,inverse linkedlist, merge linkedlist ,fb AGAIN********** (4) (MUST)
167 Two Sum II - Input array is sorted Python O(n) O(1) Easy two pointer, dict, binary search,good basic, amazon OK* (6)
259 3Sum Smaller Python O(n^2) O(1) Medium ๐Ÿ”’, LintCode, good trick, google, fb, check #015 3 Sum, check #001 two sum AGAIN******** (4)
283 Move Zeroes Python O(n) O(1) Easy basic, trick, ,two pointers,Shopee,fb AGAIN** (4)
344 Reverse String Python O(n) O(1) Easy OK
345 Reverse Vowels of a String Python O(n) O(1) Easy google OK
349 Intersection of Two Arrays Python O(m + n) O(min(m, n)) Easy EPI, Hash, Binary Search, fb OK
350 Intersection of Two Arrays II Python O(m + n) O(1) Easy EPI, Hash, Binary Search, good basic, fb OK** (3)
360 Sort Transformed Array Python O(n) O(1) Medium trick,๐Ÿ”’,google ,fb AGAIN*** (3)
457 Circular Array Loop Python O(n) O(1) Medium AGAIN (not start)
567 Permutation in String Python O(n) O(1) Medium Collections.counter good basic,sliding window,substring, good basic,M$, fb OK********* (7)
611 Valid Triangle Number Python O(n^2) O(1) Medium AGAIN (not start)
777 Swap Adjacent in LR String Python O(n) O(1) Medium AGAIN (not start)
826 Most Profit Assigning Work Python O(mlogm + nlogn) O(n) Medium trick, good basic, zip+sorted OK*
844 Backspace String Compare Python O(m + n) O(1) Easy good basic,stack,google, fb OK* (4)
876 Middle of the Linked List Python O(n) O(1) Easy basic, amazon, apple, google, 2 pointers, linkedlist OK* (2)
904 Fruit Into Baskets Python O(n) O(1) Medium AGAIN (not start)
930 Binary Subarrays With Sum Python O(n) O(1) Medium trick AGAIN* (2) (not start)
977 Squares of a Sorted Array Python O(n) O(1) Easy OK
1151 Minimum Swaps to Group All 1's Together Python O(n) O(1) Medium good basic, 2 pointers, Deque (Double-ended Queue), amazon AGAIN***** (not start )
1963 Minimum Number of Swaps to Make the String Balanced Python O(n) O(h) Medium good basic, greedy, stack, 2 pointers, amazon, fb, m$ AGAIN******** (2)
2104 Sum of Subarray Ranges Python O(n) O(1) Medium LC 907, monotonic stack, brute force, 2 pointers, dp, amazon AGAIN******* (3)

Recursion

# Title Solution Time Space Difficulty Note Status
10 Regular Expression Matching Python O(n) O(h) Hard recursive, dp, amazon AGAIN (not start)
095 Unique Binary Search Trees II Python O(4^n / n^(3/2) O(4^n / n^(3/2) Medium recursion, BST, amazon, google, apple AGAIN!!! (1)(good trick)
098 Validate Binary Search Tree Python O(n) O(1) Medium Curated Top 75, recursion, bfs, dfs,BST,M$,amazon, fb AGAIN****************** (10)
100 Same Tree Python O(n) O(h) Easy Curated Top 75, recursion, dfs, bfs, good basic,amazon OK****** (4) (but again)
104 Maximum Depth of Binary Tree Python O(n) O(h) Easy Curated Top 75, DFS, BFS, good basic,amazon, LC 111 OK****** (3) (but again)
105 Construct Binary Tree from Preorder and Inorder Traversal Python O(n) O(n) Medium Curated Top 75, trick, check # 106,BST,M$, fb AGAIN********* (8)
106 Construct Binary Tree from Inorder and Postorder Traversal Python O(n) O(n) Medium trick,check # 105,BST,M$, fb AGAIN******* (6)
108 Convert Sorted Array to Binary Search Tree Python O(n) O(logn) Medium good concept AGAIN*
109 Convert Sorted List to Binary Search Tree Python O(n) O(logn) Medium list,BST,good concept, fb AGAIN*** (3)
110 Balanced Binary Tree Python O(n) O(h) Easy good trick,dfs, bloomberg,amazon ,fb, google, spotify AGAIN********** (4)
111 Minimum Depth of Binary Tree Python O(n) O(h) Easy good basic,dfs,BST,amazon,fb, LC 104 AGAIN******** (4)
114 Flatten Binary Tree to Linked List Python O(n) O(h) Medium BST, dfs, M$, fb AGAIN**** (4)
116 Populating Next Right Pointers in Each Node Python O(n) O(1) Medium bfs, dfs, tree, recursion ,AGAIN,fb, amazon AGAIN****** (5)
117 Populating Next Right Pointers in Each Node II Python O(n) O(h) Medium Populating Next Right Pointers in Each Node I, bfs, linked list, amazon, fb AGAIN****** (3)
129 Sum Root to Leaf Numbers Python O(n) O(h) Medium trick,BST, dfs, fb AGAIN*** (4)
156 Binary Tree Upside Down Python O(n) O(1) Medium ๐Ÿ”’ AGAIN (not start)
241 Different Ways to Add Parentheses Python O(n * 4^n / n^(3/2)) O(n * 4^n / n^(3/2)) Medium AGAIN (not start)
298 Binary Tree Longest Consecutive Sequence Python O(n) O(h) Medium bfs, dfs, tree, ๐Ÿ”’, google OK***** (3)
333 Largest BST Subtree Python O(n) O(h) Medium ๐Ÿ”’ AGAIN (not start)
337 House Robber III Python O(n) O(h) Medium amazon, google AGAIN (not start)
395 Longest Substring with At Least K Repeating Characters Python O(n) O(1) Medium AGAIN,recursion, good trick,fb AGAIN************ (4)
404 Sum of Left Leaves Python O(n) O(h) Easy, tree, bfs, dfs fb OK**** (3)
437 Path Sum III Python O(n) O(h) Medium good trick,UBER, AMAZON, fb AGAIN*** (3)
544 Output Contest Matches Python O(n) O(n) Medium AGAIN
549 Binary Tree Longest Consecutive Sequence II Python O(n) O(h) Medium ๐Ÿ”’ AGAIN (not start)
669 Trim a Binary Search Tree Python O(n) O(h) Medium good basic, BST, dfs, recursion,amazon AGAIN******* (4)
671 Second Minimum Node In a Binary Tree Python O(n) O(h) Easy dfs,tree OK* (2)

Binary Search

# Title Solution Time Space Difficulty Tag, Note Status
033 Search in Rotated Sorted Array Python Medium Curated Top 75, binary search,good basic ,check # 81 Search in Rotated Sorted Array II,UBER,amazon,fb AGAIN************ (5) (MUST)
034 Find First and Last Position of Element in Sorted Array Python O(n) O(1) Medium binary search, LC top 100 like, amazon, fb, google, apple, uber AGAIN************** (4) (MUST)
034 Search for a Range Python O(logn) O(1) Medium AGAIN*
035 Search Insert Position Python O(logn) O(1) Medium AGAIN
069 Sqrt(x) Python O(logn) O(1) Medium math, binary search,amazon,fb OK* (4)
074 Search a 2D Matrix Python O(logm + logn) O(1) Medium binary search in 2D matrix,amazon OK* (2)
081 Search in Rotated Sorted Array II Python O(logn) O(1) Medium binary search,check # 33 Search in Rotated Sorted Array first,array, fb, amazon, linkedin OK***** (6)
153 Find Minimum in Rotated Sorted Array Python O(logn) O(1) Medium Curated Top 75, binary search, good basic,amazon AGAIN****** (2)
162 Find Peak Element Python O(logn) O(1) Medium good trick, recursive binary search,M$, google, fb AGAIN********** (5)
222 Count Complete Tree Nodes Python O((logn)^2) O(1) Medium AGAIN (not start)
275 H-Index II Python O(logn) O(1) Medium similar as # 274 H-Index, Binary Search, fb AGAIN**** (3)
278 First Bad Version Python O(logn) O(1) Easy good basic,LintCode, fb OK*** (5) (but again)
300 Longest Increasing Subsequence Python O(nlogn) O(n) Medium Curated Top 75, array, binary search,DP good basic, binary search, LintCode, DP,amazon,fb AGAIN********** (8)
367 Valid Perfect Square Python O(logn) O(1) Easy good basic, similar as # 69 Sqrt(x) OK* (3)
374 Guess Number Higher or Lower Python O(logn) O(1) Easy OK*
410 Split Array Largest Sum Python O(logn) O(1) Hard AGAIN (not start)
436 Find Right Interval Python O(nlogn) O(n) Medium AGAIN (not start)
475 Heaters Python O((m + n) * logn) O(1) Easy AGAIN (not start)
540 Single Element in a Sorted Array Python O(logn) O(1) Medium OK*
658 Find K Closest Elements Python O(logn + k) O(1) Medium good trick, sorting, stack, two pointers,binary search,amazon,fb, google AGAIN ************** (5) (MUST)
744 Find Smallest Letter Greater Than Target Python O(logn) O(1) Easy OK*
852 Peak Index in a Mountain Array Python O(logn) O(1) Easy LC 162 Find Peak Element, amazon OK* (2)
875 Koko Eating Bananas Python O(nlogr) O(1) Medium binary search, good basic AGAIN******* (3)
894 All Possible Full Binary Trees Python O(n * 4^n / n^(3/2)) O(n * 4^n / n^(3/2)) Medium AGAIN (not start)
911 Online Election Python ctor: O(n)
query : O(logn)
O(n) Medium AGAIN (not start)
1011 Capacity To Ship Packages Within D Days Python Medium good trick, binary search, amazon, apple, fb, m$ AGAIN****** (2)
1889 Minimum Space Wasted From Packaging Python Hard heap, prefix sum, binary search, amazon AGAIN (not start)
2009 Minimum Number of Operations to Make Array Continuous Python Hard binary search, sliding window, dequeue, bisect.bisect_right, amazon AGAIN (not start)

Binary Search Tree

# Title Solution Time Space Difficulty Tag,Note Status
220 Contains Duplicate III python O(nlogk) O(k) Medium AGAIN (not start)
230 Kth Smallest Element in a BST python O(max(h, k)) O(min(h, k)) Medium Curated Top 75, good basic BST basic, BST,amazon OK********* (3) (but AGAIN)
235 Lowest Common Ancestor of a Binary Search Tree python O(h) O(1) Easy Curated Top 75, BST, recursion, iteration, good basic, LCA, check # 236 Lowest Common Ancestor of a Binary Tree, amazon,fb OK**************** (but again)(9)
270 Closest Binary Search Tree Value python O(h) O(1) Easy good basic ,๐Ÿ”’, M$, BST, google,fb OK***** (5)
285 Inorder Successor in BST python O(h) O(1) Medium BST, dfs, good basic, ๐Ÿ”’,amazon,fb OK** (4)
449 Serialize and Deserialize BST python O(n) O(h) Medium LC 297, dfs, bfs, good trick,serizlize deserizlize, tree, amazon, fb AGAIN************* (9) (MUST)
450 Delete Node in a BST python O(h) O(h) Medium AGAIN, good trick, BST, tree, dfs AGAIN****** (6) (but again)
530 Minimum Absolute Difference in BST python O(n) O(h) Easy AGAIN*
700 Search in a Binary Search Tree python O(n) O(h) Easy BST, good basic, recursion, iteration amazon AGAIN*** (1)
776 Split BST python O(n) O(h) Medium ๐Ÿ”’, BST, tree, DFS, trick, basic, AGAIN ,amazon AGAIN******* (5) (not start***)
783 Minimum Distance Between BST Nodes python O(n) O(h) Easy OK*
426 Convert Binary Search Tree to Sorted Doubly Linked List Python Medium ,linked list, good basic UBER, lyft, amazon, google,fb AGAIN***** (5)
968 Binary Tree Cameras Python O(n) Hard amazon, dfs, bst, dp, greedy, m$ AGAIN (not start)
1022 Sum of Root To Leaf Binary Numbers Python O(n) Easy good basic, LC 257, bst path, dfs, bfs,amazon AGAIN******** (1) (MUST)
1597 Build Binary Expression Tree From Infix Expression Python O(n) Hard LC 224, recursive, iteration, stack, amazon, google, bst AGAIN*** (1)

Breadth-First Search

# Title Solution Time Space Difficulty Tag Status
102 Binary Tree Level Order Traversal Python O(n) O(n) Easy Curated Top 75, GOOD basic, dfs, bfs,UBER, apple,amazon,fb AGAIN******* (7) (must)
107 Binary Tree Level Order Traversal II Python O(n) O(n) Easy same as # 102 Binary Tree Level Order Traversal OK* (2)
103 Binary Tree Zigzag Level Order Traversal Python O(n) O(n) Medium amazon,fb OK
126 Word Ladder II Python Hard complex, trick, dfs, bfs, dfs+bfs, check # 127 Word Ladder,amazon AGAIN*** (3)
127 Word Ladder Python O(n * d) O(d) Hard/Medium good basic, check #126 Word Ladder II, bfs, UBER, amazon, M$, fb AGAIN************** (9)
130 Surrounded Regions Python O(m + n) Medium bfs, dfs,union find,good basic, amazon AGAIN*********** (5)
133 Clone Graph Python O(n) O(n) Medium Curated Top 75, good trick, check #138 Copy List with Random Pointer ,graph,dfs,bfs, copy, UBER, google,amazon,fb AGAIN**************** (9) (MUST)
207 Course Schedule Python O(|V| + |E|) O(|E|) Medium Curated Top 75, Topological Sort, backtrack, good trick,dfs, bfs , amazon,fb AGAIN**************** (11) (MUST)
210 Course Schedule II Python O(|V| + |E|) O(|E|) Medium Topological Sort,check # 207 Course Schedule first, dfs, bfs ,amazon ,fb AGAIN********* (9) (again)
261 Graph Valid Tree Python O(|V| + |E|) O(|V| + |E|) Medium Curated Top 75, AGAIN, bfs, dfs, grpah, ๐Ÿ”’, graph,quick union,union find ,google,amazon,fb AGAIN************* (8)
286 Walls and Gates Python O(m * n) O(g) Medium ๐Ÿ”’, dfs, bfs , good basic, google,amazon,FB AGAIN******** (7)
310 Minimum Height Trees Python O(n) O(n) Medium complex AGAIN (3) (not start)
433 Minimum Genetic Mutation Python O(n * b) O(b) Medium check # 127 Word Ladder, good basic AGAIN*** (3)
444 Sequence Reconstruction Python O(n * s) O(n) Medium ๐Ÿ”’ Topological Sort , google, airbnb AGAIN** (3) (not start)
490 The Maze Python O(max(r, c) * w) O(w) Medium basic, bfs, dfs,amazon,fb AGAIN**** (5)
505 The Maze II Python O(max(r, c) * wlogw) O(w) Medium trick,bfs,dfs,AGAIN, google, fb AGAIN********* (6)
542 01 Matrix Python O(m * n) O(m * n) Medium DP, trick,queue AGAIN*** (3)
666 Path Sum IV Python O(n) O(w) Medium ๐Ÿ”’ Topological Sort AGAIN* (3) (not start)
742 Closest Leaf in a Binary Tree Python O(n) O(n) Medium AGAIN, Graph, bfs+dfs, search, good trick, amazon AGAIN********** (6)
743 Network Delay Time Python O(|E| * log|V|) O(|E|) Medium Dijkstra's algorithm AGAIN (not start)
752 Open the Lock Python O(k * n^k + d) O(k * n^k + d) Medium LC 863 AGAIN (not start)
787 Cheapest Flights Within K Stops Python O(|E| * log|V|) O(|E|) Medium Dijkstra's algorithm, dfs, bfs, graph, priority queue,amazon, apple, google, airbnb AGAIN****** (3) (not start)
815 Bus Routes Python O(|E| * log|V|) O(|E|) Hard shortest route, graph, bfs,amazon AGAIN*** (2) (not start)
886 Possible Bipartition Python O(|V| + |E|) O(|V| + |E|) Medium check # 785 Is Graph Bipartite?,graph, AGAIN,union find ,fb AGAIN********** (6)
934 Shortest Bridge Python O(n^2) O(n^2) Medium BFS, DFS, complex AGAIN (not start)
967 Numbers With Same Consecutive Differences Python O(2^n) O(2^n) Medium good trick AGAIN** (3)
675 Cut Off Trees for Golf Event Python, Java Hard tree, BFS, complex, amazon AGAIN (not start)
864 Shortest Path to Get All Keys Python Hard BFS, amazon AGAIN (not start)
994 Rotting Oranges Python Medium BFS, dp amazon OK** (2)
1162 As Far from Land as Possible Python Medium dfs, bfs, good basic, amazon AGAIN**** (3)
1730 Shortest Path to Get Food Python Medium shortest path, bfs, amazon OK (2)

Depth-First Search

# Title Solution Time Space Difficulty Tag Status
112 Path Sum Python, Scala O(n) O(h) Easy good concept, amazon, dfs OK** (2)
113 Path Sum II Python O(n) O(h) Medium dfs, LC 112 Path Sum,good basic, amazon, fb AGAIN****** (5)
199 Binary Tree Right Side View Python O(n) O(h) Medium good basic, dfs, bfs,apple,amazon, fb OK*** (5)
200 Number of Islands Python O(m * n) O(m * n) Medium Curated Top 75, bfs, dfs,good basic,check # 694, 711 Number of Distinct Islands,apple, Goldman Sachs,google,amazon,fb OK****** (6)
236 Lowest Common Ancestor of a Binary Tree Python O(n) O(h) Medium trick,EPI, LCA,check 235 Lowest Common Ancestor of a Binary Search Tree,apple,amazon,linkedin,fb AGAIN************* (9)
247 Strobogrammatic Number II Python O(n^2 * 5^(n/2)) O(n) Medium ๐Ÿ”’,check #246 Strobogrammatic Number,good trick, google,fb AGAIN******** (4)
250 Count Univalue Subtrees Python O(n) O(h) Medium ๐Ÿ”’ AGAIN (not start)
257 Binary Tree Paths Python O(n * h) O(h) Easy good basic,apple, google, amazon, fb, bfs, dfs, bst AGAIN********* (MUST) (6)
332 Reconstruct Itinerary Python O(t! / (n1! * n2! * ... nk!)) O(t) Medium yelp, google AGAIN* (3) (not start)
339 Nested List Weight Sum Python O(n) O(h) Easy ๐Ÿ”’,good basic,bfs, linkedin, fb AGAIN*** (3)
364 Nested List Weight Sum II Python O(n) O(h) Medium ๐Ÿ”’, linkedin AGAIN*
366 Find Leaves of Binary Tree Python O(n) O(h) Medium ๐Ÿ”’, linkedin AGAIN*
399 Evaluate Division Python O(q * |V|!) O(e) Medium union find, dfs, AGAIN, good trick google, fb AGAIN*********** (6)
417 Pacific Atlantic Water Flow Python O(m * n) O(m * n) Medium Curated Top 75, 2 direction dfs, dfs, matrix, m$,google AGAIN** (3)
464 Can I Win Python O(n!) O(n) Medium DP, linkedin AGAIN* (not start)
491 Increasing Subsequences Python Medium trick,dfs,dfs good trick, dp,yahoo ,fb AGAIN***** (2)
515 Find Largest Value in Each Tree Row Python O(n) O(h) Medium good basic,linkedin AGAIN* (3)
529 Minesweeper Python Medium dfs, bfs, good basic, dfs, bfs,amazon AGAIN**** (4)
547 Friend Circles Python O(n^2) O(n) Medium graph, Union Find,dfs, bfs,check # 733 Flood Fill,bloomberg ,fb AGAIN*** (3) (not start)
547 Number of Provinces Python O(n^2) O(n) Medium dfs, bfs, graph, union find, good basic, apple, amazon AGAIN************ (2) (MUST)
582 Kill Process Python O(n) O(n) Medium ๐Ÿ”’, DFS, BFS,good basic ,bloomberg, amazon AGAIN***** (4)
638 Shopping Offers Python O(n * 2^n) O(n) Medium google AGAIN (not start*)
690 Employee Importance Python O(n) O(h) Easy DFS, BFS,good basic ,UBER OK** (3)
694 Number of Distinct Islands Python O(m * n) O(m * n) Medium #200, #711 Number of Islands good pattern, dfs, ๐Ÿ”’, compare with # 200 Number of Islands, amazon AGAIN******** (5)
695 Max Area of Island Python O(m * n) O(m * n) Easy amazon, microsoft, linkedin, basic AGAIN* (3)
711 Number of Distinct Islands II Python, Java Hard complex, dfs, check # 200, 694 Number of Distinct Islands,amazon OK*** (3)
721 Accounts Merge Python O(nlogn) O(n) Medium dfs, Disjoint Set Union (DSU), Union Find,path compression, complex, fb, google, amazon, m$, apple, twitter AGAIN******* (4) (not start)
733 Flood Fill Python O(m * n) O(m * n) Easy fb, amazon, good basic OK**** (5)
734 Sentence Similarity Python O(n + p) O(p) Easy good basic, graph, hash table,collections.defaultdict(set) ,google OK***** (4) (but again)
737 Sentence Similarity II Python O(m * n) O(m * n) Medium dfs, union find, google AGAIN**** (2)
756 Pyramid Transition Matrix Python O(a^b) O(a^b) Medium AGAIN (3) (not start)
785 Is Graph Bipartite? Python O(|V| + |E|) O(|V|) Medium check #886 Possible Bipartition,AGAIN,graph,dfs,fb, amazon AGAIN*********** (6)
797 All Paths From Source to Target Python O(p + r * n) O(n) Medium graph, dfs classics, good basic AGAIN** (3)
802 Find Eventual Safe States Python O(|V| + |E|) O(|V|) Medium Topological Sort AGAIN (3) (not start)
841 Keys and Rooms Python O(n!) O(n) Medium google, bfs, dfs, good basic AGAIN*** (3)
851 Loud and Rich Python O(q + r) O(q + r) Medium amazon,defaultdict, good basic AGAIN*** (3)
1192 Critical Connections in a Network Python O(q + r) O(q + r) Hard Tarjan's algorithm,dfs, graph, fb, amazon AGAIN** (1) (not start)
1644 Lowest Common Ancestor of a Binary Tree II Python O(q + r) O(q + r) Medium LCA, LC 236, m$, fb AGAIN (not start)
1650 Lowest Common Ancestor of a Binary Tree III Python O(q + r) O(q + r) Medium parent node, good trick, dfs, set, dict, LCA, LC 236, amazon, google, spotify m$, fb AGAIN******** (2) (MUST)
1676 Lowest Common Ancestor of a Binary Tree IV Python O(q + r) O(q + r) Medium LCA, LC 236, a m$ AGAIN (not start)

Backtracking

# Title Solution Time Space Difficulty Tag, Note Status
017 Letter Combinations of a Phone Number Python O(n * 4^n) O(n) Medium dfs, backtrack, good trick,UBER, amazon, google, fb AGAIN************* (10) (MUST)
022 Generate Parentheses Python O(4^n / n^(3/2)) O(n) Medium LC 20, good basic, DFS, backtracking,amazon OK******* (3) (but again)
039 Combination Sum Python O(k * n^k) O(k) Medium backtrack,dfs,good basic,UBER, airbnb, amazon,fb OK********* (7) (but again)
040 Combination Sum II Python O(k * C(n, k)) O(k) Medium similar as #39 Combination Sum AGAIN*** (3) (again)
046 Permutations Python O(n * n!) O(n) Medium backtrack, LC #77, 78, good concept, M$, linkedin, amazon,fb OK*********** (4) (AGAIN, MUST)
047 Permutations II Python O(n * n!) O(n) Medium similar as #46 Permutations, apple, amazon, m$ AGAIN (not start)
077 Combinations Python O(O(k * C(n, k))) O(k) Medium good trick, backtrack OK********** (4) (but again, MUST)
079 Word Search Python O(m * n * l) O(l) Medium LC 212, Curated Top 75, back tracking,good trick,dfs,bloomberg, M$, amazon,fb AGAIN*************** (10) (MUST)
093 Restore IP Addresses Python O(1) O(1) Medium good trick,recursive,IP address,amazon AGAIN****** (4)
078 Subsets Python O(n * 2^n) O(1) Medium good concept , similar as, dfs, back track, #90 Subsets II , UBER, amazon, fb AGAIN**************** (7) (MUST again!!!)
090 Subsets II Python O(n * 2^n) O(1) Medium good basic,check # 078 Subsets, dfs, backtrack, fb AGAIN********* (6)
131 Palindrome Partitioning Python O(n^2) ~ O(2^n) O(n^2) Medium dfs, backtracking, good trick,amazon AGAIN*********** (6) (MUST)
139 Word Break Python O(n * l^2) O(n) Medium Curated Top 75, backtracking, dfs, dp,trick,UBER,yahoo,amazon, google,fb AGAIN**************** (7) (MUST)
140 Word Break II Python O(n * l^2) O(n) Hard good basic, LC 078, backtracking, dfs, dp,trick, amazon AGAIN******** (2)
212 Word Search II Python O(m * n * l) O(l) Hard Curated Top 75, LC 208, LC 079, hashset, hashmap, trie, backtrack with trie, amazon, fb, apple, twitter, uber, google, indeed AGAIN********** (3)
216 Combination Sum III Python O(k * C(n, k)) O(k) Medium AGAIN*
254 Factor Combinations Python O(nlogn) O(logn) Medium ๐Ÿ”’ AGAIN (not start)
267 Palindrome Permutation II Python O(n * n!) O(n) Medium ๐Ÿ”’ AGAIN (not start*)
294 Flip Game II Python O(n + c^2) O(c) Medium ๐Ÿ”’, DP, Hash AGAIN*
320 Generalized Abbreviation Python O(n * 2^n) O(n) Medium ๐Ÿ”’ AGAIN (not start*)
526 Beautiful Arrangement Python O(n!) O(n) Medium AGAIN (not start*)
676 Implement Magic Dictionary Python O(n) O(d) Medium Trie, DFS AGAIN (not start)
698 Partition to K Equal Sum Subsets Python O(n * 2^n) O(2^n) Medium DFS, DP, Memoization, similar as #416 Partition Equal Subset Sum, #473 Matchsticks to Square AGAIN (not start*)
718 Maximum Length of Repeated Subarray Python O(m * n) O(min(m, n)) Medium DP, Hash, Binary Search AGAIN (not start*)
784 Letter Case Permutation Python O(n * 2^n) O(1) Medium dfs, recursion, good trick,fb AGAIN****** (3)
980 Unique Paths III Python O(n * 2^n) O(1) Hard backtrack, dfs, amazon, google,fb AGAIN**** (1)

Dynamic Programming

# Title Solution Time Space Difficulty Tag Status
053 Maximum Subarray Python O(n) O(1) easy Curated Top 75, brute force, divied & conquer, DP,dp basic,amazon,fb AGAIN******** (5)
062 Unique Paths Python O(m * n) O(m + n) Medium Curated Top 75, dp, basic, fb, google, apple, amazon, m$ AGAIN**** (2)
063 Unique Paths II Python O(m * n) O(m + n) Medium trick, check #062 Unique Paths, amazon AGAIN*
064 Minimum Path Sum Python O(m * n) O(m + n) Medium DP, amazon AGAIN*
070 Climbing Stairs Python O(logn) O(1) Easy Curated Top 75, Matrix Exponentiation, DP, recursion, apple OK* (2)
072 Edit Distance Python O(logn) O(1) Hard top 100 like, DP, recursion, apple, google, amazon again (not start)
091 Decode Ways Python O(n) O(1) Medium Curated Top 75, good basic,dp, M$, UBER, amazon,fb AGAIN************ (4)
096 Unique Binary Search Trees Python O(n) O(1) Medium dp, Math, fb, amazon AGAIN* (2) (not start)
120 Triangle Python O(m * n) O(n) Medium amazon AGAIN* (not start) (2)
123 Best Time to Buy and Sell Stock III Python O(m * n) O(n) Hard amazon, uber, apple AGAIN* (not start) (1)
152 Maximum Product Subarray Python O(n) O(1) Medium dp, brute force, Curated Top 75, google, amazon, linkedin AGAIN***** (1)
198 House Robber Python O(n) O(1) Easy Curated Top 75, dp basic,amazon AGAIN*** (2)
213 House Robber II Python O(n) O(1) Medium brute force, recursion, dp, Curated Top 75, google, amazon AGAIN (not start)
221 Maximal Square Python O(n^2) O(n) Medium EPI, dp, amazon,fb AGAIN** (3) (not start)
256 Paint House Python O(n) O(1) Medium ๐Ÿ”’ AGAIN (not start)
276 Paint Fence Python O(n) O(1) Easy ๐Ÿ”’ AGAIN
279 Perfect Squares Python O(n * sqrt(n)) O(n) Medium dp, bfs, trick, Hash, google AGAIN*
303 Range Sum Query - Immutable Python ctor: O(n), lookup: O(1) O(n) Easy OK
304 Range Sum Query 2D - Immutable Python ctor: O(m * n), lookup: O(1) O(m * n) Medium dp,trick,fb AGAIN******* (5)
309 Best Time to Buy and Sell Stock with Cooldown Python O(n) O(1) Medium AGAIN (not start)
322 Coin Change Python O(n * k) O(k) Medium Curated Top 75, bfs, dfs, dp, grab, google, fb, apple, amazon AGAIN************* (5) (MUST)
351 Android Unlock Patterns Python O(9^2 * 2^9) O(9 * 2^9) Medium ๐Ÿ”’ Backtracking, DP, google AGAIN (not start)
357 Count Numbers with Unique Digits Python O(n) O(1) Medium Backtracking, Math AGAIN (not start)
361 Bomb Enemy Python O(m * n) O(m * n) Medium ๐Ÿ”’ , google AGAIN* (2)
368 Largest Divisible Subset Python O(n^2) O(n) Medium AGAIN (not start)
375 Guess Number Higher or Lower II Python O(n^2) O(n^2) Medium AGAIN (not start)
377 Combination Sum IV Python O(nlogn + n * t) O(t) Medium Curated Top 75, AGAIN, dp basic ,fb AGAIN******** (3)
403 Frog Jump Python O(nlogn + n * t) O(t) Hard dfs, bfs, Memoization dfs, dp, amazon, tik-tok, m$ AGAIN (not start)
416 Partition Equal Subset Sum Python O(n * s) O(s) Medium dp, fb, google, apple, amazon AGAIN** (not start) (1)
418 Sentence Screen Fitting Python O(r + n * c) O(n) Medium ๐Ÿ”’, dp, google AGAIN (not start)
467 Unique Substrings in Wraparound String Python O(n) O(1) Medium AGAIN (not start)
471 Encode String with Shortest Length Python O(n^3) on average O(n^2) Medium ๐Ÿ”’, dp, google AGAIN (not start)
472 Concatenated Words Python O(n * l^2) O(n * l) Hard good trick,trie+dfs, dp, dfs,amazon AGAIN******** (3)
474 Ones and Zeroes Python O(s * m * n) O(m * n) Medium dp, google AGAIN (not start)
486 Predict the Winner Python O(n^2) O(n) Medium good basic,dp, google AGAIN*****
509 Fibonacci Number Python O(logn) O(1) Easy variant of Climbing Stairs, Matrix Exponentiation, Spotify OK**
516 Longest Palindromic Subsequence Python O(n^2) O(n) Medium good DP basic,dp, UBER, amazon AGAIN******
562 Longest Line of Consecutive One in Matrix Python O(m * n) O(n) Medium ๐Ÿ”’, dp, google AGAIN (not start)
576 Out of Boundary Paths Python O(N * m * n) O(m * n) Medium dp, bfs AGAIN (not start)
583 Delete Operation for Two Strings Python O(m * n) O(n) Medium dp, google AGAIN (not start)
650 2 Keys Keyboard Python O(sqrt(n)) O(1) Medium dp,dp basic ,M$ AGAIN*
673 Number of Longest Increasing Subsequence Python O(n^2) O(n) Medium dp,good trick, fb AGAIN********** (3)
688 Knight Probability in Chessboard Python O(k * n^2) O(n^2) Medium dp,dp basic,AGAIN, M$,Goldman Sachs, google, fb, amazon AGAIN********* (5)
712 Minimum ASCII Delete Sum for Two Strings Python O(m * n) O(n) Medium dp AGAIN (not start)
714 Best Time to Buy and Sell Stock with Transaction Fee Python O(n) O(1) Medium AGAIN, good basic, dp, greedy,fb AGAIN******** (3)
740 Delete and Earn Python O(n) O(1) Medium AGAIN (not start)
746 Min Cost Climbing Stairs Python O(n) O(1) Easy good dp basic,dp, amazon AGAIN**** (2)
750 Number Of Corner Rectangles Python O(n * m^2) O(n * m) Medium dp,fb AGAIN (3) (not start)
764 Largest Plus Sign Python O(n^2) O(n^2) Medium dp, complex ,fb AGAIN (not start) (2)
788 Rotated Digits Python O(logn) O(logn) Easy Brute Force, Memoization OK*
790 Domino and Tromino Tiling Python O(logn) O(1) Medium Matrix Exponentiation, dp, google AGAIN (not start)
799 Champagne Tower Python O(n^2) O(n) Medium dp AGAIN
801 Minimum Swaps To Make Sequences Increasing Python O(n) O(1) Medium dp, amazon, fb AGAIN***** (not start) (2)
808 Soup Servings Python O(1) O(1) Medium AGAIN (not start)
813 Largest Sum of Averages Python O(k * n^2) O(n) Medium dp, google AGAIN (not start)
823 Binary Trees With Factors Python O(n^2) O(n) Medium dp AGAIN (not start)
837 New 21 Game Python O(n) O(n) Medium dp, google AGAIN (not start)
838 Push Dominoes Python O(n) O(n) Medium dp,two pointers,google AGAIN (not start)
877 Stone Game Python O(n^2) O(n) Medium variant of Predict the Winner AGAIN (not start)
926 Flip String to Monotone Increasing Python O(n) O(1) Medium good trick, dp, prefix sum, google, amazon AGAIN********** (4)
931 Minimum Falling Path Sum Python O(n^2) O(1) Medium google, goldman sachs AGAIN (not start)
935 Knight Dialer Python O(logn) O(1) Medium Matrix Exponentiation, google, M$, fb AGAIN (not start)
518 Coin Change 2 Python O(logn) O(1) Medium dp basic,good trick,check # 322 Coin Change,dp, google, fb AGAIN******** (4)
494 Target Sum Python O(logn) O(1) Medium dp basic, dp, fb AGAIN***** (1)
1000 Minimum Cost to Merge Stones Python O(logn) O(1) Medium dp, amazon AGAIN (not start)
1143 Longest Common Subsequence Python O(logn) O(1) Medium Curated Top 75, Memoization, dp, amazon, karat AGAIN*** (2) (not start)
1312 Minimum Insertion Steps to Make a String Palindrome Python O(logn) O(1) Hard dp, amazon AGAIN (not start)
1335 Minimum Difficulty of a Job Schedule Python O(logn) O(1) Medium dp, amazon not start
1799 Maximize Score After N Operations Python O(logn) O(1) Medium dp, amazon not start

Greedy

# Title Solution Time Space Difficulty Tag, Note Status
011 Container With Most Water Python O(n) O(1) Medium Curated Top 75, good basics, two pointers,fb, amazon OK*** (3) (but again !!)
045 Jump Game II Python O(n) O(1) Medium Greedy, google, apple, fb, tesla, amazon AGAIN******** (2) (MUST)
055 Jump Game Python O(n) O(1) Medium Curated Top 75, good trick, Greedy, DP, amazon AGAIN******** (5)
084 Largest Rectangle in Histogram Python O(n) O(1) Hard top 100 like, 2 pointers, brute force, divide and conquer, stack, LC 085, amazon, fb AGAIN (not start)
122 Best Time to Buy and Sell Stock II Python O(n) O(1) Easy compare with #309 Best Time to Buy and Sell Stock with Cooldown , #714 Best Time to Buy and Sell Stock with Transaction Fee, amazon OK* (2)
134 Gas Station Python O(n) O(1) Medium trick, greedy,amazon AGAIN****** (5)
135 Candy Python O(n) O(1) Hard LC 123, greedy, array, amazon AGAIN (not start)
330 Patching Array Python O(n) O(1) Hard array, greedy,amazon AGAIN (not start)
358 Rearrange String k Distance Apart Python O(n) O(1) Medium heap, greedy, check LC 767 not start
376 Wiggle Subsequence Python O(n) O(1) Medium AGAIN*
392 Is Subsequence Python O(n) O(1) Medium basics OK*
397 Integer Replacement Python O(n) O(1) Medium Recursion basics, Math OK*
402 Remove K Digits Python O(n) O(n) Medium LintCode AGAIN (not start*)
435 Non-overlapping Intervals Python O(nlogn) O(1) Medium Curated Top 75, good trick, 2 pointers, inverval, similiar as #452 Minimum Number of Arrows to Burst Balloons, Line Sweep, google AGAIN********* (6)
452 Minimum Number of Arrows to Burst Balloons Python O(nlogn) O(1) Medium AGAIN*
455 Assign Cookies Python O(nlogn) O(1) Easy OK*
621 Task Scheduler Python O(n) O(1) Medium trick,array,greedy, fb, amazon AGAIN****** (7)
646 Maximum Length of Pair Chain Python O(nlogn) O(1) Medium good trick, greedy, similar as #435 Non-overlapping Intervals, Line Sweep, amazon OK********** (5) (but again)
649 Dota2 Senate Python O(n) O(n) Medium complex question AGAIN (not start*)
659 Split Array into Consecutive Subsequences Python O(n) O(1) Medium AGAIN (not start*)
738 Monotone Increasing Digits Python O(1) O(1) Medium good trick, greedy, string, trick, Amazon AGAIN********* (4)
763 Partition Labels Python O(n) O(n) Medium greedy,trick,dict,index,amazon AGAIN******* (5) (AGAIN)
767 Reorganize String Python O(n) O(1) Medium greedy,counter,good trick,amazon,fb AGAIN**************** (7) (MUST)
861 Score After Flipping Matrix Python O(r * c) O(1) Medium AGAIN (not start*)
870 Advantage Shuffle Python O(nlogn) O(n) Medium OK*
881 Boats to Save People Python O(nlogn) O(n) Medium good trick OK*
948 Bag of Tokens Python O(nlogn) O(1) Medium Two Pointers AGAIN (not start)
962 Maximum Width Ramp Python O(n) O(n) Medium Descending Stack AGAIN (not start)
1024 Video Stitching Python Medium Spotify AGAIN (not start)
1102 Path With Maximum Minimum Value Python Medium dfs, dp , greedy, amazon not start
319 Bulb Switcher Python Medium not start
672 Bulb Switcher II Python Medium not start
1375 Bulb Switcher III Python Medium queue, array, gra* AGAIN*** (1)
1648 Sell Diminishing-Valued Colored Balls Python Medium trick, sorting, heapq, binary search, greedy, amazon AGAIN*** (2) (not start)
1710 Maximum Units on a Truck Python Easy sort, greedy, amazon AGAIN******** (3) (MUST)

Graph

# Title Solution Time Space Difficulty Status Note
269 Alien Dictionary Python Hard Curated Top 75, dfs, bfs, topology sort, fb, google, m$, airbnb, uber, amazon AGAIN******** (3) (not start)
323 Number of Connected Components in an Undirected Graph Python O(n) O(n) Medium Curated Top 75, ๐Ÿ”’ , dfs, Union Find, graph, linkedin, amazon, fb, google, m$, linkedin AGAIN************** (5) (MUST)
959 Regions Cut By Slashes Python O(n^2) O(n^2) Medium Union Find
1135 Connecting Cities With Minimum Cost Python O(n^2) O(n^2) Medium union find, Kruskal, prime, graph, amazon AGAIN (not start)

Geometry

# Title Solution Time Space Difficulty Status Note
892 Surface Area of 3D Shapes C++ Python O(n^2) O(1) Easy
0587 Erect the Fence Python O(nlogn) O(n) Hard complex, Convex Hull, Monotone Chain , amazon
0892 Surface Area of 3D Shapes

Design

# Title Solution Time Space Difficulty Tag Note
0146 LRU Cache Python O(1) O(k) Hard good basic, LRU,Least Recently Used, LinkedHashMap, OrderedDict, priority queue, LinkedList, amazon AGAIN***** (3)
0225 Implement Stack using Queues C++ Python push: O(n), pop: O(1), top: O(1) O(n) Easy
284 Peeking Iterator C++ Python O(1) O(1) Medium good basic, google, apple not start*** (1)
348 Design Tic-Tac-Toe Python O(1) O(n^2) Medium matrix, array, ๐Ÿ”’, google, fb, amazon AGAIN****** (5)
353 Design Snake Game C++ Python O(1) O(s) Medium ๐Ÿ”’, amazon, google, square, m$ Deque
355 Design Twitter Python O(klogu) O(t + f) Medium good trick, data structure, heapq, defaultdict, amazon OK******** (6)
0359 Logger Rate Limiter C++ Python O(1), amortized O(k) Easy ๐Ÿ”’ Deque
0362 Design Hit Counter C++ Python O(1), amortized O(k) Medium ๐Ÿ”’ Deque
0379 Design Phone Directory C++ Python O(1) O(n) Medium ๐Ÿ”’
0380 Insert Delete GetRandom O(1) Python O(1) O(n) Medium/Hard set, list, dict, amazon,fb OK* (5)
0381 Insert Delete GetRandom O(1) - Duplicates allowed C++ Python O(1) O(n) Hard
432 All O`one Data Structure C++ Python O(1) O(n) Hard
460 LFU Cache Python O(1) O(k) Hard Least Frequently Used (LFU) cache, complex, amazon AGAIN*** (2) (not start)
535 Encode and Decode TinyURL Python O(1) O(n) Medium hash map, "duplicated", "hash map collision" ,UBER, amazon,google ,fb, design OK**** (5)
588 Design In-Memory File System C++ Python ls: O(l + klogk)
mkdir: O(l)
addContentToFile: O(l + c)
readContentFromFile: O(l + c)
O(n + s) Hard dict, a bit complex basic, ๐Ÿ”’, shoptify, amazon AGAIN******* (3)
0604 Design Compressed String Iterator C++ Python O(1) O(1) Easy ๐Ÿ”’
622 Design Circular qeque Python Medium ๐Ÿ”’
631 Design Excel Sum Formula C++ Python set: O((r * c)^2)
get: O(1)
sum: O((r * c)^2)
O(r * c) Hard ๐Ÿ”’
635 Design Log Storage System C++ Python put: O(1)
retrieve: O(n + dlogd)
O(n) Medium ๐Ÿ”’
641 Design Circular Deque Python Medium ๐Ÿ”’
642 Design Search Autocomplete System Python O(p^2) O(p * t + s) Hard ๐Ÿ”’, amazon AGAIN**** (not start) (5)
705 Design HashSet Python Easy
706 Design HashMap Python Easy
0715 Range Module C++ Python add: O(n)
remove: O(n)
query: O(logn)
O(n) Hard
716 Max Stack Python push: O(logn)
pop: O(logn)
popMax: O(logn)
top: O(1)
peekMax: O(1)
O(n) Easy basic, stack, amazon again*
745 Prefix and Suffix Search Python ctor: O(w * l^2)
search : O(p + s)
O(t) Hard Trie, fb Not start* (1) (good basic)
900 RLE Iterator C++ Python O(n) O(1) Medium
1146 Snapshot Array C++ Python set: O(1)
get: O(logn)
O(n) Medium
1166 Design File System C++ Python create: O(n)
get: O(n)
O(n) Medium ๐Ÿ”’, design, google, airbnb, amazon AGAIN***** (1)
1172 Dinner Plate Stacks C++ Python push: O(logn)
pop: O(1), amortized
popAtStack: (logn)
O(n * c) Hard
1206 Design Skiplist C++ Python O(logn), on average O(n) Hard
1236 Web Crawler C++ Python O(|V| + |E|) O(|V|) Medium ๐Ÿ”’, BFS, DFS
1244 Design A Leaderboard C++ Python ctor: O(1)
add: O(1)
top: O(n)
reset: O(1)
O(n) Medium
1268 Search Suggestions System Python ctor: O(n * l)
suggest: O(l^2)
O(t) Medium good basic, array, heap, sort, Trie, amazon AGAIN******** (3)
1286 Iterator for Combination C++ Python O(k) O(k) Medium Stack
1429 First Unique Number Python O(k) O(k) Medium good trick, heap, amazon AGAIN*** (not start)
1472 Design Browser History Python O(k) O(k) Medium AGAIN
1500 Design a File Sharing System Python O(k) O(k) Medium design, hashmap AGAIN*** (not start)
1603 Design Parking System Python O(k) O(k) Easy design, amazon , paypal OK
1628 Design an Expression Tree With Evaluate Function Python O(k) O(k) Medium complex, design, amazon AGAIN*** (not start)
1656 Design an Ordered Stream Python O(k) O(k) Easy
1670 Design Front Middle Back Queue Python O(k) O(k) Medium good basic, Design, amazon AGAIN** (1) (not start)
1756 Design Recent Used Queue Python O(k) O(k) Medium design, queue AGAIN
1797 Design Authentication Manager Python O(k) O(k) Medium design, hashmap AGAIN
1976 Number of Ways to Arrive at Destination Python O(k) O(k) Medium

Simulation

# Title Solution Time Space Difficulty Status Note
874 Walking Robot Simulation C++ Python O(n + k) O(k) Easy

Concurrency

# Title Solution Time Space Difficulty Tag Note
1114 Print in Order C++ Python O(n) O(1) Easy
1115 Print FooBar Alternately C++ Python O(n) O(1) Medium
1116 Print Zero Even Odd C++ Python O(n) O(1) Medium
1117 Building H2O C++ Python O(n) O(1) Hard
1188 Design Bounded Blocking Queue C++ Python O(n) O(1) Medium ๐Ÿ”’
1195 Fizz Buzz Multithreaded C++ Python O(n) O(1) Medium
1226 The Dining Philosophers C++ Python O(n) O(1) Medium
1242 Web Crawler Multithreaded C++ Python O(|V| + |E|) O(|V|) Medium ๐Ÿ”’
1279 Traffic Light Controlled Intersection C++ Python O(n) O(1) Easy ๐Ÿ”’

SQL

# Title Solution Time Space Difficulty Tag, Note Status
0175 Combine Two Tables MySQL O(m + n) O(m + n) Easy OK (4)
0176 Second Highest Salary MySQL O(n) O(1) Easy amazon,fb OK (4)
0177 Nth Highest Salary MySQL O(n^2) O(n) Medium MySQL PROCEDURE, SQL FAQ AGAIN*** (3)
0178 Rank Scores MySQL O(n^2) O(n) Medium trick, SQL var, ank, select same table, rank AGAIN****** (7)
0180 Consecutive Numbers MySQL O(n) O(n) Medium SQL var, join same table multi times OK* (3)
0181 Employees Earning More Than Their Managers MySQL O(n^2) O(1) Easy OK
0182 Duplicate Emails MySQL O(n^2) O(n) Easy OK
0183 Customers Who Never Order MySQL O(n^2) O(1) Easy left join OK** (3) (but again)
0184 Department Highest Salary MySQL O(n^2) O(n) Medium trick, where, good basic OK***** (but again) (6)
0185 Department Top Three Salaries MySQL O(n^2) O(n) Hard similiar as # 0177 Nth Highest Salary, good trick, top N in group AGAIN******** (5)
0196 Delete Duplicate Emails MySQL O(n^2) O(n) Easy, delete command AGAIN (2)
0197 Rising Temperature MySQL O(n^2) O(n) Easy OK
0262 Trips and Users MySQL O((t * u) + tlogt) O(t) Hard case condisions OK* (2)
0511 Game Play Analysis I MySQL O(n) O(n) Easy ๐Ÿ”’ OK
0512 Game Play Analysis II MySQL O(n) O(n) Easy ๐Ÿ”’, 2 col where good trick AGAIN**(4)
0534 Game Play Analysis III MySQL O(nlogn) O(n) Medium ๐Ÿ”’, SQL var, tricky, window func AGAIN******** (6)
0550 Game Play Analysis IV MySQL O(n) O(n) Medium case, fraction, join, good basic, where min condition OK*********** (7) (but again)
569 Median Employee Salary MySQL O(n) O(n) Medium medium number AGAIN* (not start)
571 Find Median Given Frequency of Numbers MySQL O(n) O(n) Medium medium number AGAIN** (not start) (2)
577 Employee Bonus MySQL O(n) O(n) Easy OK
578 Get Highest Answer Rate Question MySQL Medium fb, case condition OK* (3)
579 Find Cumulative Salary of an Employee MySQL Hard window function, amazon, good trick OK***** (5)(but again)
580 Count Student Number in Departments MySQL Medium OK*** (2) (but again)
595 Big Countries MySQL Easy OK
597 Friend Requests I: Overall Acceptance Rate MySQL Medium select distinct, ifnull,fb OK*** (7)
601 Human Traffic of Stadium MySQL Hard consecutive nums OK* (1)
602 Friend Requests II: Who Has Most Friend? MySQL Medium union all, fb OK*** (4)
603 Consecutive Available Seats MySQL Medium consecutive nums, good basic, cross join OK***** (3)(but again)
618 Students Report By Geography MySQL Hard sql var AGAIN (not start)
620 Not Boring Movies MySQL Easy OK
626 Exchange Seats MySQL Medium AGAIN (not start)
627 Swap Salary MySQL Easy UPDATE with CASE, good basic OK* (1) (but again)
1045 Customers Who Bought All Products MySQL O(n + k) O(n + k) Medium ๐Ÿ”’, where with count OK*** (4)
1050 Actors and Directors Who Cooperated At Least Three Times MySQL O(n) O(n) Easy ๐Ÿ”’ OK
1068 Product Sales Analysis I MySQL O(m + n) O(m + n) Easy ๐Ÿ”’ OK
1069 Product Sales Analysis II MySQL O(n) O(n) Easy ๐Ÿ”’ OK
1070 Product Sales Analysis III MySQL O(n) O(n) Medium ๐Ÿ”’ OK
1075 Project Employees I MySQL O(m + n) O(m + n) Easy ๐Ÿ”’ OK
1076 Project Employees II MySQL O(n) O(n) Easy ๐Ÿ”’ OK (2)
1077 Project Employees III MySQL O((m + n)^2) O(m + n) Medium ๐Ÿ”’, tricky where OK***** (2) (but again)
1082 Sales Analysis I MySQL O(n) O(n) Easy ๐Ÿ”’, group by only 1 col, good basic OK***** (5) (again)
1083 Sales Analysis II MySQL O(m + n) O(m + n) Easy ๐Ÿ”’, not in OK*** (3) (again)
1084 Sales Analysis III MySQL O(m + n) O(m + n) Easy ๐Ÿ”’ OK** (2)
1097 Game Play Analysis V MySQL O(n^2) O(n) Hard ๐Ÿ”’, good basic,retention, case condition, retention, data_add, left join AGAIN******* (8)
1098 Unpopular Books MySQL O(m + n) O(n) Medium ๐Ÿ”’, where not in OK* (2)
1107 New Users Daily Count MySQL O(n) O(n) Medium ๐Ÿ”’ OK*
1112 Highest Grade For Each Student MySQL O(nlogn) O(n) Medium ๐Ÿ”’, good basic OK** (4)
1113 Reported Posts MySQL O(n) O(n) Easy ๐Ÿ”’ OK
1126 Active Businesses MySQL O(n) O(n) Medium ๐Ÿ”’, good basic AGAIN*** (3)
1127 User Purchase Platform MySQL O(n) O(n) Hard ๐Ÿ”’, complex, union all, case OK**** (6) (but again)
1132 Reported Posts II MySQL O(m + n) O(n) Medium ๐Ÿ”’ OK*** (4)
1141 User Activity for the Past 30 Days I MySQL O(n) O(n) Easy ๐Ÿ”’ AGAIN* (2)
1142 User Activity for the Past 30 Days II MySQL O(n) O(n) Easy ๐Ÿ”’ AGAIN* (1)
1148 Article Views I MySQL O(nlogn) O(n) Easy ๐Ÿ”’ OK
1149 Article Views II MySQL O(nlogn) O(n) Medium ๐Ÿ”’ OK*
1158 Market Analysis I MySQL O(m + n) O(m + n) Medium ๐Ÿ”’, case when ... is not null AGAIN**** (5)
1159 Market Analysis II MySQL O(m + n) O(m + n) Hard ๐Ÿ”’, good trick AGAIN** (3)
1164 Product Price at a Given Date MySQL O(mlogn) O(m) Medium ๐Ÿ”’, good trick, union, case, not in a period AGAIN******** (2)
1173 Immediate Food Delivery I MySQL O(n) O(1) Easy ๐Ÿ”’ OK
1174 Immediate Food Delivery II MySQL O(n) O(m) Medium ๐Ÿ”’ OK**** (3)
1179 Reformat Department Table MySQL O(n) O(n) Easy ๐Ÿ”’ OK
1193 Monthly Transactions I MySQL O(n) O(n) Medium ๐Ÿ”’ OK (2)
1194 Tournament Winners MySQL O(m + n + nlogn) O(m + n) Hard ๐Ÿ”’ AGAIN*
1204 Last Person to Fit in the Elevator MySQL O(nlogn) O(n) Medium ๐Ÿ”’, cumsum, window func, good basic OK****** (3)
1205 Monthly Transactions II MySQL O(n) O(n) Medium ๐Ÿ”’, good trick, union all, case conditions OK*** (3) (but again)
1211 Queries Quality and Percentage MySQL O(n) O(n) Easy OK
1212 Team Scores in Football Tournament MySQL O(nlogn) O(n) Medium good trick OK** (2)
1225 Report Contiguous Dates MySQL O(nlogn) O(n) Hard ๐Ÿ”’ AGAIN* (2) (not start)
1241 Number of Comments per Post MySQL O(n) O(n) Easy ๐Ÿ”’, good basic OK**** (5) (but again)
1251 Average Selling Price MySQL O(n) O(n) Easy ๐Ÿ”’, good basic OK*** (but again) (3)
1264 Page Recommendations MySQL O(m + n) O(m) Medium ๐Ÿ”’ OK** (2)
1270 All People Report to the Given Manager MySQL O(n) O(n) Medium ๐Ÿ”’, good basic OK* (3)
1280 Students and Examinations MySQL O((m * n) * log(m * n)) O(m * n) Easy ๐Ÿ”’ OK (1)
1285 Find the Start and End Number of Continuous Ranges MySQL O(n) O(n) Medium ๐Ÿ”’, variable AGAIN (not start) (1)
1294 Weather Type in Each Country MySQL O(m + n) O(n) Easy ๐Ÿ”’ OK (1)
1303 Find the Team Size MySQL O(n) O(n) Easy ๐Ÿ”’ ok (1)
1308 Running Total for Different Genders MySQL O(nlogn) O(n) Medium ๐Ÿ”’, good basic, union all, window func OK**** (3)
1321 Restaurant Growth MySQL O(n^2) O(n) Medium ๐Ÿ”’, good basic, trick AGAIN***** (3)
1322 Ads Performance MySQL O(nlogn) O(n) Easy ๐Ÿ”’, good basic OK******* (3) (but again)
1327 List the Products Ordered in a Period MySQL O(n) O(n) Easy ๐Ÿ”’ OK
1336 Number of Transactions per Visit MySQL O(m + n) O(m + n) Medium ๐Ÿ”’, complex, variable AGAIN (not start)
1341 Movie Rating MySQL O(nlogn) O(n) Medium ๐Ÿ”’ AGAIN (not start)
1350 Students With Invalid Departments MySQL O(n) O(n) Easy ๐Ÿ”’ OK
1355 Activity Participants MySQL O(n) O(n) Medium ๐Ÿ”’ OK
1364 Number of Trusted Contacts of a Customer MySQL O(n + m + l + nlogn) O(n + m + l) Medium ๐Ÿ”’ OK
1369 Get the Second Most Recent Activity MySQL O(nlogn) O(n) Hard ๐Ÿ”’, union, having OK** (2) (but again)
1378 Replace Employee ID With The Unique Identifier MySQL O(n) O(n) Easy ๐Ÿ”’ OK
1384 Total Sales Amount by Year MySQL O(nlogn) O(n) Hard ๐Ÿ”’, complex OK*
1393 Capital Gain/Loss MySQL O(n) O(n) Medium ๐Ÿ”’ OK
1398 Customers Who Bought Products A and B but Not C MySQL O(m + n) O(m + n) Medium ๐Ÿ”’ OK
1407 Top Travellers MySQL O(m + nlogn) O(m + n) Easy ๐Ÿ”’, ifnull OK*
1412 Find the Quiet Students in All Exams MySQL O(m + nlogn) O(m + n) Hard ๐Ÿ”’, good trick, not in, inner join on multiple cols OK**** (3) (but again)
1421 NPV Queries MySQL O(n) O(n) Medium ๐Ÿ”’ OK
1435 Create a Session Bar Chart MySQL O(n) O(1) Easy ๐Ÿ”’ OK
1440 Evaluate Boolean Expression MySQL O(n) O(n) Medium ๐Ÿ”’ OK
1445 Apples & Oranges MySQL O(n) O(n) Medium ๐Ÿ”’ OK
1454 Active Users MySQL O(nlogn) O(n) Medium ๐Ÿ”’, good basic, window func AGAIN*** (2)
1459 Rectangles Area MySQL O(n^2) O(n^2) Medium ๐Ÿ”’ OK*
1468 Calculate Salaries MySQL O(m + n) O(m + n) Easy ๐Ÿ”’ OK*
1479 Sales by Day of the Week MySQL O(m + n) O(n) Hard ๐Ÿ”’, case, DAYOFWEEK OK
1484 Group Sold Products By The Date MySQL O(nlogn) O(n) Easy ๐Ÿ”’, GROUP_CONCAT OK*
1495 Friendly Movies Streamed Last Month MySQL O(n) O(n) Easy ๐Ÿ”’ OK
1501 Countries You Can Safely Invest In MySQL O(n) O(n) Medium ๐Ÿ”’,good trick, group avg, global avg, SUBSTRING, inner join on or conditions OK****** (4)
1511 Customer Order Frequency MySQL O(n) O(n) Easy ๐Ÿ”’, having, like OK* (1)
1517 Find Users With Valid E-Mails MySQL O(n) O(n) Easy ๐Ÿ”’, regular expression AGAIN
1527 Patients With a Condition MySQL O(n) O(n) Easy ๐Ÿ”’ OK
1532 The Most Recent Three Orders MySQL O(nlogn) O(n) Medium ๐Ÿ”’, window func, good basic OK** (2) (but again)
1543 Fix Product Name Format MySQL O(nlogn) O(n) Easy ๐Ÿ”’, trim OK
1549 The Most Recent Orders for Each Product MySQL O(nlogn) O(n) Medium ๐Ÿ”’, max day per id, good basic OK* (again)
1555 Bank Account Summary MySQL O(m + n) O(m + n) Medium ๐Ÿ”’, union all, good trick OK**** (2)(but again)
1565 Unique Orders and Customers Per Month MySQL O(n) O(n) Easy ๐Ÿ”’ OK
1571 Warehouse Manager MySQL O(n) O(n) Medium ๐Ÿ”’ OK* (1)
1581 Customer Who Visited but Did Not Make Any Transactions MySQL O(n) O(n) Easy ๐Ÿ”’, left join, good basic OK** (2)(but again)
1587 Bank Account Summary II MySQL O(m + n) O(m + n) Easy ๐Ÿ”’ OK
1596 The Most Frequently Ordered Products for Each Customer MySQL O(n) O(n) Medium ๐Ÿ”’, good trick, rank() ORDER BY count, get max in each group OK********* (3)(but again)
1607 Sellers With No Sales MySQL O(nlogm) O(n + m) Medium ๐Ÿ”’ OK
1613 Find the Missing IDs MySQL O(n^2) O(n) Medium ๐Ÿ”’, RECURSIVE CTE, good trick AGAIN*** (2)
1623 All Valid Triplets That Can Represent a Country MySQL O(n^3) O(n^3) Easy ๐Ÿ”’, <> AGAIN* (not start)
1633 Percentage of Users Attended a Contest MySQL O(m + nlogn) O(n) Easy ๐Ÿ”’ OK
1635 Hopper Company Queries I MySQL O(d + r + tlogt) O(d + r + t) Hard ๐Ÿ”’, complex AGAIN (not start)
1645 Hopper Company Queries II MySQL O(d + r + tlogt) O(d + r + t) Hard ๐Ÿ”’, complex AGAIN (not start)
1651 Hopper Company Queries III MySQL O(d + r + tlogt) O(d + r + t) Hard ๐Ÿ”’, complex AGAIN (not start)
1661 Average Time of Process per Machine MySQL O(n) O(n) Easy ๐Ÿ”’, good basic OK* (1)
1667 Fix Names in a Table MySQL O(nlogn) O(n) Easy ๐Ÿ”’, concat, sub-string OK (1)
1677 Product's Worth Over Invoices MySQL O(nlogn) O(n) Easy ๐Ÿ”’ OK
1683 Invalid Tweets MySQL O(n) O(n) Easy ๐Ÿ”’ OK
1693 Daily Leads and Partners MySQL O(n) O(n) Easy ๐Ÿ”’ OK
1699 Number of Calls Between Two Persons MySQL O(n) O(n) Medium ๐Ÿ”’, cte, union all OK* (1)(but again)
1709 Biggest Window Between Visits MySQL O(nlogn) O(n) Medium ๐Ÿ”’, window func, datediff, coalesce, good trick AGAIN***** (2)
1715 Count Apples and Oranges MySQL O(n) O(n) Medium ๐Ÿ”’, ifnull OK (2)
1729 Find Followers Count MySQL O(nlogn) O(n) Easy ๐Ÿ”’ OK
1731 The Number of Employees Which Report to Each Employee MySQL O(nlogn) O(n) Easy ๐Ÿ”’ OK
1741 Find Total Time Spent by Each Employee MySQL O(nlogn) O(n) Easy ๐Ÿ”’ OK
1747 Leetflex Banned Accounts MySQL O(n^2) O(n) Medium ๐Ÿ”’ OK (2) (but again)
1757 Recyclable and Low Fat Products MySQL O(n) O(n) Easy ๐Ÿ”’ OK
1767 Find the Subtasks That Did Not Execute MySQL O(n * c) O(n * c) Hard ๐Ÿ”’, RECURSIVE CTE AGAIN (not start)
1777 Product's Price for Each Store MySQL O(n) O(n) Easy ๐Ÿ”’ OK (2)
1783 Grand Slam Titles MySQL O(n) O(n) Medium ๐Ÿ”’, union all, good basic OK* (1) (but again)
1789 Primary Department for Each Employee MySQL O(n) O(n) Easy ๐Ÿ”’, where id in OK (1) (but again)
1795 Rearrange Products Table MySQL O(n) O(n) Easy ๐Ÿ”’, union all, good basic OK****** (2)
1809 Ad-Free Sessions MySQL O(n) O(n) Easy ๐Ÿ”’, left join where col is null OK**** (3)(but again)
1811 Find Interview Candidates MySQL O(nlogn) O(n) Medium ๐Ÿ”’, union all, cte, where, good basic AGAIN* (2)
1821 Find Customers With Positive Revenue this Year MySQL O(n) O(n) Easy ๐Ÿ”’ OK
1831 Maximum Transaction Each Day MySQL O(nlogn) O(n) Medium ๐Ÿ”’, rank(), where on 2 attr, good basic AGAIN**** (2)
1841 League Statistics MySQL O(nlogn) O(n) Medium ๐Ÿ”’, case, complex AGAIN* (2)
1843 Suspicious Bank Accounts MySQL O(nlogn) O(n) Medium ๐Ÿ”’, good trick, window func OK** (2) (but AGAIN)
1853 Convert Date Format MySQL O(n) O(n) Easy ๐Ÿ”’ OK
1867 Orders With Maximum Quantity Above Average MySQL O(n) O(n) Easy ๐Ÿ”’ OK (1)
1873 Calculate Special Bonus MySQL O(n) O(n) Easy ๐Ÿ”’, left, odd num OK (2)
1875 Group Employees of the Same Salary MySQL O(nlogn) O(n) Medium ๐Ÿ”’, complex, good basic AGAIN* (1)
1890 The Latest Login in 2020 MySQL O(n) O(n) Easy ๐Ÿ”’ OK
1892 Page Recommendations II MySQL O(n * m) O(n * m) Hard ๐Ÿ”’ AGAIN*** (1) (not start)
1907 Count Salary Categories MySQL O(n) O(n) Medium ๐Ÿ”’, union all OK* (1)
1917 Leetcodify Friends Recommendations MySQL O(n^2) O(n^2) Hard ๐Ÿ”’, NOT EXISTS AGAIN*** (2)
1919 Leetcodify Similar Friends MySQL O(n * l) O(n * l) Hard ๐Ÿ”’ AGAIN* (not start)
1934 Confirmation Rate MySQL O(n + m) O(n + m) Medium ๐Ÿ”’, good basic OK* (1) (but again)
1939 Users That Actively Request Confirmation Messages MySQL O(nlogn) O(n) Easy ๐Ÿ”’, TIMESTAMPDIFF, good basic OK*** (2) (but again)
1949 Strong Friendship MySQL O(n^3) O(n^2) Medium ๐Ÿ”’ good basic, where in 2 cols
1951 All the Pairs With the Maximum Number of Common Followers MySQL O(n^3) O(n^2) Medium ๐Ÿ”’, good trick AGAIN* (2)
1965 Employees With Missing Information MySQL O(nlogn) O(n) Easy ๐Ÿ”’, good basic OK* (1) (but again)
1972 First and Last Call On the Same Day MySQL O(n) O(n) Hard ๐Ÿ”’, rank, union all, amazon AGAIN** (2)
1978 Employees Whose Manager Left the Company MySQL O(nlogn) O(n) Easy ๐Ÿ”’ OK (1)
1988 Find Cutoff Score for Each School MySQL O(n * m) O(n * m) Medium ๐Ÿ”’, no ref AGAIN (not start)
1990 Count the Number of Experiments MySQL O(n) O(n) Easy ๐Ÿ”’, cross join AGAIN* (1)
2004 The Number of Seniors and Juniors to Join the Company MySQL O(nlogn) O(n) Hard ๐Ÿ”’, not ref AGAIN (not start)

Shell Script

# Title Solution Time Space Difficulty Tag Note
0192 Word Frequency Shell O(n) O(k) Medium
0193 Valid Phone Numbers Shell O(n) O(1) Easy
0194 Transpose File Shell O(n^2) O(n^2) Medium
0195 Tenth Line Shell O(n) O(1) Easy
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].