Skip to content

Latest commit

 

History

History
378 lines (371 loc) · 108 KB

README.md

File metadata and controls

378 lines (371 loc) · 108 KB

Algorithms

ID Blog Solutions Diffculty Tags
1137 N-th Tribonacci Number 2
.cpp
701 Insert into a Binary Search Tree 2
.cpp
445 Add Two Numbers II 1
.cpp
MEDIUM STACK
LINKED LIST
997 Find the Town Judge 1
.java
442 Find All Duplicates in an Array 1
.py
MEDIUM
896 Monotonic Array 2
.cpp
1180 Count Substrings with Only One Distinct Letter 4
.cpp
1221 Split a String in Balanced Strings 1
.cpp
1260 Shift 2D Grid 1
.cpp
EASY GRID
SIMULATION
1261 Find Elements in a Contaminated Binary Tree 1
.cpp
MEDIUM DFS
297 Serialize and Deserialize Binary Tree 1
.cpp
5453 Running Sum of 1d Array 1
.cpp
EASY PREFIX SUM
994 Rotting Oranges 1
.cpp
EASY BFS
1502 Can Make Arithmetic Progression From Sequence 1
.cpp
EASY SORTING
1400 Construct K Palindrome Strings 1
.cpp
MEDIUM BITSET
PALINDROME
280 Wiggle Sort 2
.cpp
246 Strobogrammatic Number 2
.cpp
1020 Partition Array Into Three Parts With Equal Sum 1
.cpp
34 Find First and Last Position of Element in Sorted Array 3
.js
.cpp
1087 Brace Expansion 2
.cpp
1614 Maximum Nesting Depth of the Parentheses 1
.cpp
EASY STRING
362 Design Hit Counter 2
.cpp
1110 Delete Nodes And Return Forest 1
.cpp
949 Largest Time for Given Digits 1
.cpp
EASY PERMUTATION
515 Find Largest Value in Each Tree Row 2
.cpp
171 Excel Sheet Column Number 1
.py
EASY
929 Unique Email Addresses 3
.js
.cpp
1208 Get Equal Substrings Within Budget 1
.cpp
1404 Number of Steps to Reduce a Number in Binary Representation to One 1
.cpp
EASY BINARY
300 Longest Increasing Subsequence 1
.cpp
1570 Dot Product of Two Sparse Vectors 1
.cpp
999 Available Captures for Rook 1
.cpp
1220 Count Vowels Permutation 1
.cpp
HARD DP
201 Bitwise AND of Numbers Range 1
.cpp
MEDIUM BIT
908 Smallest Range I 1
.cpp
52 N-Queens II 1
.cpp
HARD RECURSION
BACKTRACKING
DFS
507 Perfect Number 2
.cpp
346 Moving Average from Data Stream 1
.cpp
EASY DEQUE
1244 Design A Leaderboard 1
.cpp
MEDIUM HASH MAP
MULTI SET
1360 Number of Days Between Two Dates 1
.cpp
EASY DATE
724 Find Pivot Index 2
.cpp
408 Valid Word Abbreviation 1
.cpp
1491 Average Salary Excluding the Minimum and Maximum Salary 1
.cpp
EASY
985 Sum of Even Numbers After Queries 2
.java
.js
367 Valid Perfect Square 4
.cpp
970 Powerful Integers 1
.cpp
350 Intersection of Two Arrays II 4
.js
.cpp
.java
931 Minimum Falling Path Sum 1
.cpp
1160 Find Words That Can Be Formed by Characters 1
.cpp
1188 Design Bounded Blocking Queue 1
.py
MEDIUM THREADING
593 Valid Square 2
.java
.cpp
1037 Valid Boomerang 3
.cpp
1190 Reverse Substrings Between Each Pair of Parentheses 1
.cpp
1008 Construct Binary Search Tree from Preorder Traversal 3
.java
.cpp
1218 Longest Arithmetic Subsequence of Given Difference 1
.cpp
703 Kth Largest Element in a Stream 1
.cpp
860 Lemonade Change 1
.cpp
693 Binary Number with Alternating Bits 2
.cpp
819 Most Common Word 2
.cpp
859 Buddy Strings 1
.cpp
700 Search in a Binary Search Tree 6
.js
.cpp
.java
645 Set Mismatch 3
.cpp
1365 How Many Numbers Are Smaller Than the Current Number 1
.cpp
EASY BINARY SEARCH
1071 Greatest Common Divisor of Strings 1
.cpp
160 Intersection of Two Linked Lists 1
.cpp
951 Flip Equivalent Binary Trees 2
.cpp
18 4Sum 1
.cpp
647 Palindromic Substrings 2
.cpp
21 Merge Two Sorted Lists 4
.cpp
206 Reverse Linked List 1
.js
EASY RECURSION
LINKED LIST
704 Binary Search 1
.java
1513 Number of Substrings With Only 1s 1
.py
MEDIUM MATH
993 Cousins in Binary Tree 2
.cpp
844 Backspace String Compare 3
.js
.cpp
.java
82 Remove Duplicates from Sorted List II 1
.cpp
MEDIUM LINKED LIST
113 Path Sum II 2
.js
MEDIUM RECURSION
BFS
BINARY TREE
DFS
QUEUE
77 Combinations 1
.py
MEDIUM BITMASK
28 Implement strStr() 1
.cpp
108 Convert Sorted Array to Binary Search Tree 2
.cpp
EASY RECURSION
BINARY TREE
1605 Find Valid Matrix Given Row and Column Sums 1
.cpp
MEDIUM GREEDY
31 Next Permutation 1
.cpp
1314 Matrix Block Sum 1
.cpp
MEDIUM DP
1290 Convert Binary Number in a Linked List to Integer 1
.cpp
EASY BINARY NUMBER
LINKED LIST
1085 Sum of Digits in the Minimum Number 4
.py
.cpp
804 Unique Morse Code Words 2
.java
.cpp
6 ZigZag Conversion 1
.cpp
MEDIUM SIMULATION
STRING
359 Logger Rate Limiter 2
.java
.cpp
536 Construct Binary Tree from String 1
.cpp
1171 Remove Zero Sum Consecutive Nodes from Linked List 1
.cpp
MEDIUM LINKED LIST
PREFIX SUM
1154 Day of the Year 1
.cpp
EASY DATE
MATH
106 Construct Binary Tree from Inorder and Postorder Traversal 2
.cpp
110 Balanced Binary Tree 1
.cpp
EASY RECURSION
BINARY TREE
967 Numbers With Same Consecutive Differences 1
.py
MEDIUM DFS
393 UTF-8 Validation 1
.cpp
1288 Remove Covered Intervals 1
.cpp
MEDIUM LINE SWEEP
SORTING
1196 How Many Apples Can You Put into the Basket 1
.cpp
681 Next Closest Time 1
.cpp
1295 Find Numbers with Even Number of Digits 1
.cpp
EASY ARRAY
594 Longest Harmonious Subsequence 1
.cpp
EASY HASH MAP
103 Binary Tree Zigzag Level Order Traversal 2
.cpp
758 Bold Words in String 1
.cpp
1566 Detect Pattern of Length M Repeated K or More Times 1
.py
EASY BRUTEFORCE
1396 Design Underground System 1
.cpp
MEDIUM HASH MAP
1436 Destination City 1
.cpp
EASY TREE
434 Number of Segments in a String 2
.py
.cpp
151 Reverse Words in a String 1
.cpp
MEDIUM STRING
876 Middle of the Linked List 2
.cpp
252 Meeting Rooms 2
.cpp
889 Construct Binary Tree from Preorder and Postorder Traversal 1
.cpp
MEDIUM RECURSION
532 K-diff Pairs in an Array 3
.cpp
1624 Largest Substring Between Two Equal Characters 1
.cpp
EASY HASH TABLE
1228 Missing Number In Arithmetic Progression 1
.cpp
1248 Count Number of Nice Subarrays 1
.java
MEDIUM PREFIX SUM
841 Keys and Rooms 1
.cpp
1143 Longest Common Subsequence 1
.cpp
MEDIUM DP
1213 Intersection of Three Sorted Arrays 2
.py
.cpp
43 Multiply Strings 1
.java
MEDIUM ARRAY
9 Palindrome Number 1
.cpp
EASY
148 Sort List 1
.cpp
MEDIUM RECURSION
SORT
DIVIDE-AND-CONQUER
1282 Group the People Given the Group Size They Belong To 1
.cpp
MEDIUM HASH MAP
GREEDY ALGORITHM
254 Factor Combinations 2
.cpp
686 Repeated String Match 2
.js
1128 Number of Equivalent Domino Pairs 1
.cpp
1281 Subtract the Product and Sum of Digits of an Integer 1
.cpp
EASY MATH
1317 Convert Integer to the Sum of Two No-Zero Integers 1
.java
EASY BRUTEFORCE
661 Image Smoother 2
.java
.cpp
328 Odd Even Linked List 1
.cpp
MEDIUM LINKED LIST
653 Two Sum IV Input is a BST 6
.java
.cpp
1490 Clone N-ary Tree 1
.cpp
MEDIUM RECURSION
HASH MAP
DFS
1602 Find Nearest Right Node in Binary Tree 1
.cpp
MEDIUM BFS
938 Range Sum of BST 2
.cpp
1018 Binary Prefix Divisible By 5 2
.java
.cpp
856 Score of Parentheses 4
.cpp
976 Largest Perimeter Triangle 2
.java
.cpp
EASY GREEDY
ARRAY
SORTING
TRIANGLE
942 DI String Match 2
.java
.cpp
1472 Design Browser History 1
.cpp
MEDIUM DEQUE
965 Univalued Binary Tree 2
.cpp
1026 Maximum Difference Between Node and Ancestor 1
.cpp
401 Binary Watch 1
.cpp
290 Word Pattern 1
.cpp
EASY HASH MAP
394 Decode String 1
.cpp
261 Graph Valid Tree 2
.cpp
643 Maximum Average Subarray I 4
.js
.cpp
.java
339 Nested List Weight Sum 1
.cpp
1122 Relative Sort Array 3
.cpp
1528 Shuffle String 1
.py
EASY STRING
334 Increasing Triplet Subsequence 1
.cpp
572 Subtree of Another Tree 2
.cpp
1175 Prime Arrangements 1
.cpp
1232 Check If It Is a Straight Line 1
.cpp
EASY GEOMETRY
342 Power of Four 2
.cpp
348 Design Tic-Tac-Toe 1
.cpp
186 Reverse Words in a String II 2
.cpp
443 String Compression 1
.cpp
51 N-Queens 1
.cpp
HARD RECURSION
BACKTRACKING
DFS
628 Maximum Product of Three Numbers 2
.cpp
520 Detect Capital 1
.js
EASY REGEXP
STRING
22 Generate Parentheses 2
.cpp
1492 The kth Factor of n 1
.cpp
MEDIUM
905 Sort Array By Parity 4
.cpp
1387 Sort Integers by The Power Value 1
.cpp
MEDIUM RECURSION
DYNAMIC PROGRAMMING
1518 Water Bottles 1
.java
EASY SIMULATION
1612 Check If Two Expression Trees are Equivalent 1
.cpp
MEDIUM DFS
1399 Count Largest Group 1
.cpp
EASY
1161 Maximum Level Sum of a Binary Tree 1
.cpp
946 Validate Stack Sequences 1
.cpp
MEDIUM GREEDY
STACK
582 Kill Process 2
.cpp
944 Delete Columns to Make Sorted 1
.cpp
1134 Armstrong Number 1
.py
762 Prime Number of Set Bits in Binary Representation 2
.py
.cpp
1272 Remove Interval 1
.cpp
MEDIUM INTERVAL
958 Check Completeness of a Binary Tree 2
.java
.cpp
812 Largest Triangle Area 1
.cpp
392 Is Subsequence 1
.cpp
1344 Angle Between Hands of a Clock 1
.cpp
MEDIUM GEOMETRY
251 Flatten 2D Vector 2
.cpp
690 Employee Importance 4
.java
.cpp
1002 Find Common Characters 2
.java
.cpp
EASY ARRAY
STRING
1222 Queens That Can Attack the King 1
.cpp
MEDIUM ARRAY
HASHSET
766 Toeplitz Matrix 2
.cpp
560 Subarray Sum Equals K 4
.cpp
744 Find Smallest Letter Greater Than Target 4
.js
.cpp
217 Contains Duplicate 1
.js
EASY HASH SET
987 Vertical Order Traversal of a Binary Tree 1
.cpp
867 Transpose Matrix 1
.cpp
1356 Sort Integers by The Number of 1 Bits 1
.cpp
EASY BIT HACKS
SORTING
1230 Toss Strange Coins 1
.cpp
476 Number Complement 5
.java
.cpp
.js
921 Minimum Add to Make Parentheses Valid 1
.cpp
1120 Maximum Average Subtree 1
.cpp
1380 Lucky Numbers in a Matrix 1
.cpp
EASY MATRIX
1598 Crawler Log Folder 1
.cpp
EASY SIMULATION
1027 Longest Arithmetic Sequence 1
.cpp
MEDIUM DP
791 Custom Sort String 2
.cpp
537 Complex Number Multiplication 2
.js
.cpp
1275 Find Winner on a Tic Tac Toe Game 1
.cpp
EASY GAME
BRUTEFORCE
33 Search in Rotated Sorted Array 2
.java
.cpp
557 Reverse Words in a String III 3
.java
.cpp
74 Search a 2D Matrix 3
.cpp
1005 Maximize Sum Of Array After K Negations 2
.cpp
EASY ARRAY
PRIORITY QUEUE
541 Reverse String II 1
.cpp
991 Broken Calculator 1
.cpp
59 Spiral Matrix II 1
.java
MEDIUM SIMULATION
1273 Delete Tree Nodes 1
.cpp
671 Second Minimum Node In a Binary Tree 5
.java
1118 Number of Days in a Month 1
.cpp
884 Uncommon Words from Two Sentences 2
.java
1099 Two Sum Less Than K 2
.cpp
1315 Sum of Nodes with Even-Valued Grandparent 1
.java
MEDIUM RECURSION
DFS
1060 Missing Element in Sorted Array 2
.cpp
311 Sparse Matrix Multiplication 1
.cpp
250 Count Univalue Subtrees 5
.java
.cpp
873 Length of Longest Fibonacci Subsequence 2
.cpp
MEDIUM FIBONACCI
DP
BRUTEFORCE
LONGEST INCREASE SEQUENCE
228 Summary Ranges 1
.cpp
MEDIUM TWO POINTERS
941 Valid Mountain Array 2
.java
.cpp
937 Reorder Data in Log Files 1
.cpp
EASY SORTING
24 Swap Nodes in Pairs 1
.cpp
MEDIUM RECURSION
1342 Number of Steps to Reduce a Number to Zero 1
.cpp
EASY
917 Reverse Only Letters 3
.java
.cpp
353 Design Snake Game 1
.cpp
953 Verifying an Alien Dictionary 1
.cpp
125 Valid Palindrome 1
.cpp
1135 Connecting Cities With Minimum Cost 2
.cpp
482 License Key Formatting 2
.cpp
892 Surface Area of 3D Shapes 2
.cpp
EASY COUNTING
GEOMETRY
15 3Sum 2
.cpp
747 Largest Number At Least Twice of Others 1
.cpp
492 Construct the Rectangle 3
.java
1080 Insufficient Nodes in Root to Leaf Paths 1
.java
1576 Replace All ?'s to Avoid Consecutive Repeating Characters 1
.cpp
EASY STRING
1302 Deepest Leaves Sum 2
.cpp
MEDIUM DFS
BFS
1100 Find K-Length Substrings With No Repeated Characters 2
.cpp
347 Top K Frequent Elements 2
.cpp
1558 Minimum Numbers of Function Calls to Make Target Array 1
.cpp
MEDIUM MATH
166 Fraction to Recurring Decimal 1
.java
MEDIUM MATH
HASH MAP
325 Maximum Size Subarray Sum Equals k 5
.cpp
518 Coin Change 2 1
.cpp
842 Split Array into Fibonacci Sequence 1
.cpp
1506 Find Root of N-Ary Tree 1
.cpp
MEDIUM HASH SET
111 Minimum Depth of Binary Tree 1
.cpp
EASY RECURSION
DFS
961 N-Repeated Element in Size 2N Array 12
.java
.cpp
.js
.py
.php
633 Sum of Square Numbers 2
.cpp
525 Contiguous Array 1
.cpp
MEDIUM ARRAY
HASH MAP
PREFIX SUM
205 Isomorphic Strings 1
.cpp
637 Average of Levels in Binary Tree 3
.cpp
1207 Unique Number of Occurrences 1
.cpp
366 Find Leaves of Binary Tree 2
.java
.cpp
1522 Diameter of N-Ary Tree 1
.cpp
MEDIUM DFS
5087 Letter Tile Possibilities 1
.cpp
609 Find Duplicate File in System 1
.js
MEDIUM HASH MAP
501 Find Mode in Binary Search Tree 3
.cpp
504 Base 7 3
.cpp
973 K Closest Points to Origin 2
.java
.cpp
266 Palindrome Permutation 2
.cpp
170 Two Sum III - Data structure design 3
.cpp
733 Flood Fill 2
.cpp
654 Maximum Binary Tree 2
.cpp
680 Valid Palindrome II 1
.cpp
806 Number of Lines to Write String 3
.java
.cpp
1362 Closest Divisors 1
.cpp
MEDIUM MATH
1022 Sum of Root To Leaf Binary Numbers 2
.java
.cpp
1215 Stepping Numbers 1
.cpp
1200 Minimum Absolute Difference 1
.cpp
508 Most Frequent Subtree Sum 1
.cpp
821 Shortest Distance to a Character 2
.cpp
49 Group Anagrams 1
.cpp
MEDIUM SORTING
437 Path Sum III 1
.cpp
669 Trim a Binary Search Tree 1
.cpp
409 Longest Palindrome 1
.cpp
1382 Balance a Binary Search Tree 1
.cpp
MEDIUM RECURSION
BINARY TREE
1046 Last Stone Weight 1
.java
EASY PRIORITY QUEUE
1017 Convert to Base -2 2
.cpp
1291 Sequential Digits 2
.cpp
MEDIUM DFS
BFS
1328 Break a Palindrome 1
.js
MEDIUM
91 Decode Ways 1
.cpp
1021 Remove Outermost Parentheses 1
.cpp
836 Rectangle Overlap 1
.cpp
EASY GEOMETRY
1237 Find Positive Integer Solution for a Given Equation 2
.cpp
EASY BINARY SEARCH
TWO POINTER
746 Min Cost Climbing Stairs 2
.cpp
1167 Minimum Cost to Connect Sticks 2
.py
.cpp
1539 Kth Missing Positive Number 1
.cpp
EASY HASH SET
37 Sudoku Solver 1
.cpp
HARD BACKTRACKING
DFS
1253 Reconstruct a 2-Row Binary Matrix 1
.cpp
MEDIUM GREEDY
969 Pancake Sorting 1
.cpp
MEDIUM ARRAY
1458 Max Dot Product of Two Subsequences 1
.cpp
HARD DP
543 Diameter of Binary Tree 1
.cpp
EASY RECURSION
DFS
760 Find Anagram Mappings 3
.java
.cpp
1325 Delete Leaves With a Given Value 1
.java
MEDIUM RECURSION
DFS
BINARY TREE
814 Binary Tree Pruning 2
.cpp
1094 Car Pooling 2
.cpp
MEDIUM GREEDY
HASH MAP
1352 Product of the Last K Numbers 1
.cpp
230 Kth Smallest Element in a BST 8
.java
.cpp
1265 Print Immutable Linked List in Reverse 2
.cpp
MEDIUM RECURSION
LINKED LIST
STACK
1422 Maximum Score After Splitting a String 1
.cpp
EASY PREFIX SUM
845 Longest Mountain in Array 1
.cpp
MEDIUM ARRAY
915 Partition Array into Disjoint Intervals 1
.cpp
1249 Minimum Remove to Make Valid Parentheses 1
.cpp
MEDIUM GREEDY
PARENTHESES
415 Add Strings 1
.cpp
606 Construct String from Binary Tree 1
.cpp
55 Jump Game 1
.cpp
MEDIUM GREEDY
451 Sort Characters By Frequency 2
.cpp
986 Interval List Intersections 1
.cpp
MEDIUM TWO POINTER
830 Positions of Large Groups 2
.java
.cpp
247 Strobogrammatic Number II 1
.cpp
MEDIUM RECURSION
897 Increasing Order Search Tree 3
.cpp
874 Walking Robot Simulation 1
.cpp
EASY HASH SET
SIMULATION
538 Convert BST to Greater Tree 2
.cpp
105 Construct Binary Tree from Preorder and Inorder Traversal 1
.cpp
1415 The k-th Lexicographical String of All Happy Strings of Length n 1
.cpp
MEDIUM RECURSION
DFS
1485 Clone Binary Tree With Random Pointer 1
.cpp
MEDIUM RECURSION
HASH MAP
50 Pow(x, n) 1
.cpp
MEDIUM RECURSION
1165 Single-Row Keyboard 2
.cpp
EASY HASH MAP
STRING
1185 Day of the Week 1
.cpp
883 Projection Area of 3D Shapes 1
.cpp
47 Permutations II 1
.cpp
MEDIUM HASH SET
PERMUTATION
DFS
1003 Check If Word Is Valid After Substitutions 1
.cpp
MEDIUM STACK
988 Smallest String Starting From Leaf 1
.cpp
MEDIUM DFS
1299 Replace Elements with Greatest Element on Right Side 1
.cpp
EASY ARRAY
1474 Delete N Nodes After M Nodes of a Linked List 1
.cpp
EASY LINKED LIST
1437 Check If All 1's Are at Least Length K Places Away 1
.cpp
MEDIUM ARRAY
477 Total Hamming Distance 1
.cpp
256 Paint House 1
.cpp
679 24 Game 1
.cpp
322 Coin Change 2
.cpp
912 Sort an Array 3
.py
.js
.cpp
39 Combination Sum 1
.cpp
1392 Longest Happy Prefix 1
.py
709 To Lower Case 3
.cpp
.c
1006 Clumsy Factorial 1
.cpp
374 Guess Number Higher or Lower 2
.cpp
1133 Largest Unique Number 5
.py
.js
.cpp
1413 Minimum Value to Get Positive Step by Step Sum 1
.cpp
PREFIX EASY
131 Palindrome Partitioning 1
.cpp
MEDIUM DFS
922 Sort Array By Parity II 3
.cpp
16 3Sum Closest 1
.cpp
1410 HTML Entity Parser 1
.cpp
MEDIUM STRING
23 Merge k Sorted Lists 1
.cpp
HARD RECURSION
DIVIDE-AND-CONQUER
1047 Remove All Adjacent Duplicates In String 4
.py
.cpp
933 Number of Recent Calls 2
.java
.cpp
1469 Find All the Lonely Nodes 1
.cpp
EASY DFS
1119 Remove Vowels from a String 1
.cpp
438 Find All Anagrams in a String 2
.py
.cpp
566 Reshape the Matrix 4
.cpp
811 Subdomain Visit Count 2
.cpp
13 Roman to Integer 2
.cpp
133 Clone Graph 2
.java
.cpp
276 Paint Fence 1
.cpp
416 Partition Equal Subset Sum 1
.cpp
MEDIUM DP
DFS

Database

ID Blog Solutions Diffculty Tags
627 Swap Salary 2
.sql
608 Tree Node 4
.sql
577 Employee Bonus 1
.sql
584 Find Customer Referee 1
.sql
612 Shortest Distance in a Plane 4
.sql
619 Biggest Single Number 1
.sql
570 Managers with at Least 5 Direct Reports 2
.sql

Total 355 Questions: 7 Database, 348 Algorithms

Index generated by script at 24/10/2020 17:46:36