Skip to content

Latest commit

 

History

2,631 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LeetCode

602 problems solved — 553 Python · 55 SQL · 2 sh

Easy 443 · Medium 154 · Hard 5

Solutions to LeetCode problems, one directory per problem holding the statement, the solution, and — where a problem taught me something — a note on the idea that cracked it.

The table below is the part worth reading: not the code, but the one-line reason each solution works. The full index is at the bottom.

Approach notes

# Title Solution Topic Basic Idea
1 Two Sum Python Array, Hash Table HashTable: While scanning through the array, wait for the target - x using hash map
15 3Sum Python Two Pointers, Sorting 4 Cases exist: [0,0,0], [0,p,-p], [p1,p2,-(p1+p2)], [n1, n2, -(n1+n2)]
22 Generate Parentheses Python DP, Backtracking, Stack Stack: stack=[("(", l, r)]
45 Jump Game II Python DP, Greedy DP: O(n^2), Greedy: (TBD)
46 Permutations Python Backtracking Backtrack: Add nums[i] -> Go next -> Pop nums[i] with visited flag
55 Jump Game Python DP, Greedy Greedy: (Forward) if cur position > max position then False (Backward) if last position can reach the first index then True
62 Unique Paths Python Combinatorics, DP Combinatorics: (m+n-2)C(m-1), DP: dp[i][j]=dp[i-1][j]+dp[i][j-1]
70 Climbing Stairs Python DP, Math DP: dp[i]=dp[i-1]+dp[i-2] where dp[0]=1
71 Simplify Path Python String, Stack Stack: .. (pop), . or empty (ignore), else (push)
77 Combinations Python Backtracking Backtrack: Add i -> Go next -> Backtrack (=pop i)
78 Subsets Python Backtracking, Bit Manipulation Cascading: Append nums[i] (doubling the size of previous one) Backtrack: Add nums[i] -> Go next -> Backtrack (=pop nums[i])
90 Subsets II Python Backtracking, Bit Manipulation Backtrack: Same idea as #78 + set.add(tuple(sorted(list))) to remove duplicates
101 Symmetric Tree Python DFS, BFS, Stack DFS(Recursive): dfs(l.l, r.r) and dfs(l.r, r.l) Stack(Iterative): Basically, mirror idea is SAME & return False when one is None or vals are different
112 Path Sum Python BinarySearch, DFS, BFS BFS: (root, acc_sum) DFS: (targetSum-root.val) for left and right, recursively
113 Path Sum II Python DFS, BFS, Backtracking BFS: (root, [root.val])
172 Factorial Trailing Zeroes Python Math O(N): dp[i]=i//5 + dp[i//5] if i%5==0 O(logN): Add # of 5s and then # of 25s ... until it reaches N
200 Number of Islands Python DFS, BFS, UnionFind DFS: dfs(x+dx, y+dy) BFS: queue=[(x,y)]
221 Maximal Square Python DP DP: DP[i][j]=min(DP[i][j-1], DP[i-1][j], DP[i-1][j-1])+1
231 Power of Two Python Bit Manipulation BitManipulation: (2^n) and (2^n)-1 are always complementary
287 Find the Duplicate Number Python Two Pointers, Binary Search, Bit Manipulation TwoPointers:
322 Coin Change Python DP, BFS DP: dp[i]=min(dp[i-coins[0]], dp[i-coins[1]], dp[i-coins[2]], ... )+1
326 Power of Three Python Math, NumberTheory Math: math.log(n, 3), NumberTheory: Check max pow(3)%n
342 Power of Four Python Bit Manipulation, Math Math: math.log(n, 4)
437 Path Sum III Python DFS, BFS (TBD)
518 Coin Change 2 Python DP DP: dp[i]+=dp[i-coin] (Key idea: For-loop-coin-first-then-amount)
1051 Height Checker Python Sort, CountingSort Sort: 1-Liner using zip & sort
1200 Minimum Absolute Difference Python Sorting Sort and find the min with zip (arr, arr[1:])
1268 Search Suggestions System Python Trie, BinarySearch BinarySearch: sort and bisect_left Trie: (TBD)
1306 Jump Game III Python DFS, BFS BFS: q=[index] and A[index]=-1 DFS: return A[index]==0 or f(index+A[index]) or f(index-A[index])
1512 Number of Good Pairs Python HashTable, Math, Counting Math: set and count (but it requires modification of the given array), HashTable: Frequency Table is all you need
2000 Reverse Prefix of Word Python TwoPointers, String String: index and [::-1]

Recurring categories: dynamic programming, BFS, DFS, math, stack, queue, hash table, backtracking, graph.

Backtracking, as a reminder to myself, is for finding all the possible cases for a situation — the moment a problem says "return every", that is the shape to reach for.

All solutions

Generated from the repository by scripts/build_readme.py, so it cannot drift from what is actually committed.

All 602 problems
# Problem Difficulty Solution Notes
1 Two Sum Easy Python, Python
2 Add Two Numbers Medium Python, Python
3 Longest Substring Without Repeating Characters Medium Python, Python
4 Median Of Two Sorted Arrays Hard Python, Python
5 Longest Palindromic Substring Medium Python, Python
7 Reverse Integer Medium Python, Python
9 Palindrome Number Easy Python, Python
13 Roman To Integer Easy Python, Python
14 Longest Common Prefix Easy Python, Python
15 3Sum Medium Python, Python
17 Letter Combinations Of A Phone Number Medium Python, Python
20 Valid Parentheses Easy Python, Python
21 Merge Two Sorted Lists Easy Python, Python
22 Generate Parentheses Medium Python, Python
28 Find The Index Of The First Occurrence In A String Easy Python, Python
35 Search Insert Position Easy Python, Python
39 Combination Sum Medium Python, Python
42 Trapping Rain Water Hard Python, Python
45 Jump Game Ii Medium Python, Python, Python
46 Permutations Medium Python, Python
48 Rotate Image Medium Python, Python notes
49 Group Anagrams Medium Python, Python
53 Maximum Subarray Easy Python, Python, Python
55 Jump Game Medium Python, Python, Python
58 Length Of Last Word Easy Python, Python
62 Unique Paths Medium Python, Python, Python
63 Unique Paths Ii Medium Python, Python, Python
64 Minimum Path Sum Medium Python, Python, Python
66 Plus One Easy Python, Python
67 Add Binary Easy Python, Python
69 Sqrtx Easy Python, Python
70 Climbing Stairs Easy Python, Python, Python, Python
71 Simplify Path Medium Python, Python
73 Set Matrix Zeroes Medium Python, Python
75 Sort Colors Medium Python, Python
77 Combinations Medium Python, Python
78 Subsets Medium Python, Python
81 Search In Rotated Sorted Array Ii Medium Python, Python
83 Remove Duplicates From Sorted List Easy Python, Python
86 Partition List Medium Python, Python
90 Subsets Ii Medium Python, Python
91 Decode Ways Medium Python, Python
96 Unique Binary Search Trees Medium Python, Python, Python
100 Same Tree Easy Python, Python
101 Symmetric Tree Easy Python, Python
102 Binary Tree Level Order Traversal Medium Python, Python, Python
104 Maximum Depth Of Binary Tree Easy Python, Python, Python
108 Convert Sorted Array To Binary Search Tree Easy Python, Python
109 Convert Sorted List To Binary Search Tree Medium Python, Python
111 Minimum Depth Of Binary Tree Easy Python, Python
112 Path Sum Easy Python, Python
113 Path Sum Ii Medium Python, Python
118 Pascals Triangle Easy Python, Python, Python, Python
119 Pascals Triangle Ii Easy Python, Python, Python, Python
120 Triangle Medium Python, Python, Python, Python
121 Best Time To Buy And Sell Stock Easy Python, Python, Python
122 Best Time To Buy And Sell Stock Ii Medium Python, Python
125 Valid Palindrome Easy Python, Python
129 Sum Root To Leaf Numbers Medium Python, Python
136 Single Number Easy Python, Python
137 Single Number Ii Medium Python, Python
152 Maximum Product Subarray Medium Python, Python, Python, Python
162 Find Peak Element Medium Python, Python
167 Two Sum Ii Input Array Is Sorted Easy Python, Python
169 Majority Element Easy Python, Python
171 Excel Sheet Column Number Easy Python, Python
172 Factorial Trailing Zeroes Medium Python, Python
175 Combine Two Tables Easy SQL, SQL
176 Second Highest Salary Medium SQL, SQL
182 Duplicate Emails Easy SQL, SQL
183 Customers Who Never Order Easy SQL, SQL
189 Rotate Array Medium Python, Python
191 Number Of 1 Bits Easy Python, Python
192 Word Frequency Medium sh
195 Tenth Line Easy sh
196 Delete Duplicate Emails Easy SQL, SQL
197 Rising Temperature Easy SQL, SQL
198 House Robber Medium Python, Python, Python
199 Binary Tree Right Side View Medium Python, Python, Python
200 Number Of Islands Medium Python, Python, Python
202 Happy Number Easy Python, Python
203 Remove Linked List Elements Easy Python, Python
204 Count Primes Medium Python, Python
205 Isomorphic Strings Easy Python, Python
206 Reverse Linked List Easy Python, Python
213 House Robber Ii Medium Python, Python, Python
215 Kth Largest Element In An Array Medium Python, Python
217 Contains Duplicate Easy Python, Python, Python
221 Maximal Square Medium Python, Python, Python
225 Implement Stack Using Queues Easy Python, Python
226 Invert Binary Tree Easy Python, Python
228 Summary Ranges Easy Python, Python
230 Kth Smallest Element In A Bst Medium Python, Python
231 Power Of Two Easy Python, Python, Python
232 Implement Queue Using Stacks Easy Python, Python
234 Palindrome Linked List Easy Python, Python
237 Delete Node In A Linked List Easy Python, Python
238 Product Of Array Except Self Medium Python, Python
242 Valid Anagram Easy Python, Python
258 Add Digits Easy Python, Python, Python
263 Ugly Number Easy Python, Python
268 Missing Number Easy Python, Python, Python
279 Perfect Squares Medium Python, Python
283 Move Zeroes Easy Python, Python, Python
287 Find The Duplicate Number Medium Python, Python
290 Word Pattern Easy Python, Python notes
300 Longest Increasing Subsequence Medium Python, Python
303 Range Sum Query Immutable Easy Python, Python
318 Maximum Product Of Word Lengths Medium Python, Python
322 Coin Change Medium Python, Python, Python
326 Power Of Three Easy Python, Python, Python
328 Odd Even Linked List Medium Python, Python
329 Longest Increasing Path In A Matrix Hard Python, Python
334 Increasing Triplet Subsequence Medium Python, Python
338 Counting Bits Easy Python, Python
342 Power Of Four Easy Python, Python, Python
343 Integer Break Medium Python, Python
344 Reverse String Easy Python, Python
345 Reverse Vowels Of A String Easy Python, Python
347 Top K Frequent Elements Medium Python, Python
349 Intersection Of Two Arrays Easy Python, Python
350 Intersection of Two Arrays II Easy Python
367 Valid Perfect Square Easy Python, Python
371 Sum Of Two Integers Medium Python, Python
374 Guess Number Higher Or Lower Easy Python, Python
377 Combination Sum Iv Medium Python, Python
378 Kth Smallest Element In A Sorted Matrix Medium Python, Python
387 First Unique Character In A String Easy Python, Python
389 Find The Difference Easy Python, Python, Python
392 Is Subsequence Easy Python, Python, Python
404 Sum Of Left Leaves Easy Python, Python, Python
409 Longest Palindrome Easy Python, Python
412 Fizz Buzz Easy Python, Python
413 Arithmetic Slices Medium Python, Python
414 Third Maximum Number Easy Python, Python
415 Add Strings Easy Python, Python
434 Number Of Segments In A String Easy Python, Python
437 Path Sum Iii Medium Python, Python
441 Arranging Coins Easy Python, Python
451 Sort Characters By Frequency Medium Python, Python
459 Repeated Substring Pattern Easy Python, Python
461 Hamming Distance Easy Python, Python
476 Number Complement Easy Python, Python
496 Next Greater Element I Easy Python, Python
500 Keyboard Row Easy Python, Python
504 Base 7 Easy Python, Python
509 Fibonacci Number Easy Python, Python
511 Game Play Analysis I Easy SQL
513 Find Bottom Left Tree Value Medium Python, Python
515 Find Largest Value In Each Tree Row Medium Python, Python
516 Longest Palindromic Subsequence Medium Python, Python
518 Coin Change Ii Medium Python, Python, Python
520 Detect Capital Easy Python, Python
530 Minimum Absolute Difference In Bst Easy Python, Python
535 Encode And Decode Tinyurl Medium Python, Python notes
537 Complex Number Multiplication Medium Python, Python
539 Minimum Time Difference Medium Python, Python
547 Number Of Provinces Medium Python, Python
557 Reverse Words In A String Iii Easy Python, Python
559 Maximum Depth of N-ary Tree Easy Python
561 Array Partition Easy Python, Python
566 Reshape The Matrix Easy Python, Python
583 Delete Operation For Two Strings Medium Python, Python
584 Find Customer Referee Easy SQL, SQL
586 Customer Placing The Largest Number Of Orders Easy SQL
589 N-ary Tree Preorder Traversal Easy Python
594 Longest Harmonious Subsequence Easy Python, Python
595 Big Countries Easy SQL, SQL
599 Minimum Index Sum Of Two Lists Easy Python, Python
607 Sales Person Easy SQL, SQL
608 Tree Node Medium SQL, SQL
620 Not Boring Movies Easy SQL, SQL
627 Swap Sex Of Employees Easy SQL, SQL
637 Average Of Levels In Binary Tree Easy Python, Python
653 Two Sum Iv Input Is A Bst Easy Python, Python
657 Robot Return To Origin Easy Python, Python
682 Baseball Game Easy Python, Python
695 Max Area Of Island Medium Python, Python, Python
697 Degree Of An Array Easy Python, Python
700 Search in a Binary Search Tree Easy Python
704 Binary Search Easy Python, Python
709 To Lower Case Easy Python
724 Find Pivot Index Easy Python, Python
728 Self Dividing Numbers Easy Python, Python
739 Daily Temperatures Medium Python, Python
742 To Lower Case Easy Python
746 Min Cost Climbing Stairs Easy Python, Python
747 Min Cost Climbing Stairs Easy Python
766 Toeplitz Matrix Easy Python
771 Jewels and Stones Easy Python
774 Maximum Depth of N-ary Tree Easy Python
775 N-ary Tree Preorder Traversal Easy Python
777 Toeplitz Matrix Easy Python
782 Jewels and Stones Easy Python
783 Search In A Binary Search Tree Easy Python, Python
792 Binary Search Easy Python
796 Rotate String Easy Python
799 Minimum Distance Between BST Nodes Easy Python
804 Unique Morse Code Words Easy Python
812 Rotate String Easy Python
822 Unique Morse Code Words Easy Python
832 Flipping an Image Easy Python
844 Backspace String Compare Easy Python
852 Peak Index in a Mountain Array Easy Python
856 Score of Parentheses Medium Python
861 Flipping an Image Easy Python
867 Transpose Matrix Easy Python
868 Binary Gap Easy Python
874 Backspace String Compare Easy Python
876 Middle of the Linked List Easy Python
882 Peak Index in a Mountain Array Medium Python
884 Uncommon Words from Two Sentences Easy Python
886 Score of Parentheses Medium Python
890 Find and Replace Pattern Medium Python
898 Transpose Matrix Easy Python
899 Binary Gap Easy Python
905 Sort Array By Parity Easy Python
908 Middle Of The Linked List Easy Python, Python
916 Word Subsets Medium Python
920 Uncommon Words from Two Sentences Easy Python
922 Sort Array By Parity II Easy Python
926 Find and Replace Pattern Medium Python
931 Minimum Falling Path Sum Medium Python, Python
938 Range Sum of BST Easy Python
941 Sort Array By Parity Easy Python
942 DI String Match Easy Python
944 Smallest Range I Easy Python
952 Word Subsets Medium Python
953 Verifying an Alien Dictionary Easy Python
958 Sort Array By Parity II Easy Python
961 N-Repeated Element in Size 2N Array Easy Python
965 Univalued Binary Tree Easy Python
967 Minimum Falling Path Sum Medium Python
975 Range Sum of BST Easy Python
976 Largest Perimeter Triangle Easy Python, Python
977 Squares of a Sorted Array Easy Python
979 DI String Match Easy Python
983 Minimum Cost For Tickets Medium Python
988 Smallest String Starting From Leaf Medium Python
990 Verifying an Alien Dictionary Easy Python
993 Cousins in Binary Tree Easy Python
1001 N-Repeated Element in Size 2N Array Easy Python
1002 Find Common Characters Easy Python
1005 Univalued Binary Tree Easy Python
1009 Complement of Base 10 Integer Easy Python
1013 Fibonacci Number Easy Python
1014 Best Sightseeing Pair Medium Python
1018 Binary Prefix Divisible By 5 Easy Python, Python
1019 Squares of a Sorted Array Easy Python
1021 Remove Outermost Parentheses Easy Python
1022 Sum of Root To Leaf Binary Numbers Easy Python
1025 Minimum Cost For Tickets Medium Python
1029 Two City Scheduling Medium Python notes
1030 Smallest String Starting From Leaf Medium Python
1035 Cousins in Binary Tree Easy Python
1043 Partition Array for Maximum Sum Medium Python
1044 Find Common Characters Easy Python
1046 Last Stone Weight Easy Python
1050 Actors and Directors Who Cooperated At Least Three Times Easy SQL
1051 Height Checker Easy Python
1054 Complement of Base 10 Integer Easy Python
1063 Best Sightseeing Pair Medium Python
1071 Binary Prefix Divisible By 5 Easy Python
1078 Remove Outermost Parentheses Easy Python
1079 Sum of Root To Leaf Binary Numbers Easy Python
1084 Sales Analysis III Easy SQL
1091 Shortest Path in Binary Matrix Medium Python
1095 Two City Scheduling Medium Python
1108 Defanging an IP Address Easy Python
1112 Find Words That Can Be Formed by Characters Easy Python
1116 Maximum Level Sum of a Binary Tree Medium Python
1121 Partition Array for Maximum Sum Medium Python
1122 Relative Sort Array Easy Python notes
1127 Last Stone Weight Easy Python
1136 Actors and Directors Who Cooperated At Least Three Times Easy SQL
1137 Height Checker Easy Python, Python, Python
1141 User Activity for the Past 30 Days I Easy SQL
1143 Longest Common Subsequence Medium Python
1148 Article Views I Easy SQL
1158 Market Analysis I Medium SQL
1160 Find Words That Can Be Formed by Characters Easy Python
1161 Maximum Level Sum of a Binary Tree Medium Python
1171 Shortest Path in Binary Matrix Medium Python
1174 Sales Analysis III Easy SQL
1179 Game Play Analysis I Easy SQL
1200 Minimum Absolute Difference Easy Python
1205 Defanging an IP Address Easy Python
1207 Unique Number of Occurrences Easy Python
1217 Relative Sort Array Easy Python
1221 Split a String in Balanced Strings Easy Python
1231 Replace Elements with Greatest Element on Right Side Easy Python
1232 Check If It Is a Straight Line Easy Python
1236 N-th Tribonacci Number Easy Python
1241 Decompress Run-Length Encoded List Easy Python
1245 User Activity for the Past 30 Days I Easy SQL
1250 Longest Common Subsequence Medium Python
1252 Cells with Odd Values in a Matrix Easy Python
1254 Deepest Leaves Sum Medium Python, Python
1258 Article Views I Easy SQL
1264 Maximum Number of Words You Can Type Easy Python
1266 Minimum Time Visiting All Points Easy Python
1268 Market Analysis I Medium SQL, Python
1277 Count Square Submatrices with All Ones Medium Python
1281 Subtract the Product and Sum of Digits of an Integer Easy Python
1282 Group the People Given the Group Size They Belong To Medium Python
1290 Convert Binary Number in a Linked List to Integer Easy Python
1293 Three Consecutive Odds Easy Python
1295 Find Numbers with Even Number of Digits Easy Python
1299 Replace Elements with Greatest Element on Right Side Easy Python
1302 Deepest Leaves Sum Medium Python
1304 Find N Unique Integers Sum up to Zero Easy Python notes
1306 Jump Game III Medium Python, Python, Python
1309 Decrypt String from Alphabet to Integer Mapping Easy Python
1313 Decompress Run-Length Encoded List Easy Python
1319 Unique Number of Occurrences Easy Python
1323 Maximum 69 Number Easy Python
1337 The K Weakest Rows in a Matrix Easy Python notes
1341 Split a String in Balanced Strings Easy Python
1342 Number of Steps to Reduce a Number to Zero Easy Python
1349 Check If It Is a Straight Line Easy Python
1351 Count Negative Numbers in a Sorted Matrix Easy Python
1356 Sort Integers by The Number of 1 Bits Easy Python
1363 Greatest English Letter in Upper and Lower Case Easy Python
1365 How Many Numbers Are Smaller Than the Current Number Easy Python
1374 Generate a String With Characters That Have Odd Counts Easy Python
1378 Cells with Odd Values in a Matrix Easy Python
1380 Lucky Numbers in a Matrix Easy Python, Python
1385 Find the Distance Value Between Two Arrays Easy Python
1389 Create Target Array in the Given Order Easy Python
1392 Find the Difference of Two Arrays Easy Python
1393 Capital Gain/Loss Medium SQL
1395 Minimum Time Visiting All Points Easy Python
1397 Search Suggestions System Medium Python
1399 Count Largest Group Easy Python
1402 Count Square Submatrices with All Ones Medium Python
1406 Subtract the Product and Sum of Digits of an Integer Easy Python
1407 Group The People Given The Group Size They Belong To Easy Python, SQL
1411 Convert Binary Number in a Linked List to Integer Easy Python
1421 Find Numbers with Even Number of Digits Easy Python
1426 Find N Unique Integers Sum up to Zero Easy Python
1428 Jump Game III Medium Python
1430 Find the K-Beauty of a Number Easy Python
1431 Kids With the Greatest Number of Candies Easy Python
1434 Decrypt String from Alphabet to Integer Mapping Easy Python
1436 Destination City Easy Python
1441 Build an Array With Stack Operations Easy Python
1444 Number of Steps to Reduce a Number to Zero Easy Python
1446 Consecutive Characters Easy Python
1448 Count Good Nodes in Binary Tree Medium Python, Python
1450 Number of Students Doing Homework at a Given Time Easy Python
1455 Check If a Word Occurs As a Prefix of Any Word in a Sentence Easy Python
1458 Sort Integers by The Number of 1 Bits Easy Python
1461 Check If a String Contains All Binary Codes of Size K Medium Python
1463 The K Weakest Rows in a Matrix Easy Python
1464 Maximum Product of Two Elements in an Array Easy Python
1470 Shuffle the Array Easy Python
1475 Final Prices With a Special Discount in a Shop Easy Python
1476 Count Negative Numbers in a Sorted Matrix Easy Python
1480 Running Sum of 1d Array Easy Python
1482 How Many Numbers Are Smaller Than the Current Number Easy Python
1484 Group Sold Products By The Date Easy SQL
1486 Find the Distance Value Between Two Arrays Easy Python
1490 Generate a String With Characters That Have Odd Counts Easy Python
1491 Average Salary Excluding the Minimum and Maximum Salary Easy Python
1496 Lucky Numbers in a Matrix Easy Python
1500 Count Largest Group Easy Python
1502 Can Make Arithmetic Progression From Sequence Easy Python
1505 Create Target Array in the Given Order Easy Python
1509 Minimum Difference Between Largest and Smallest Value in Three Moves Medium Python
1512 Number of Good Pairs Easy Python
1523 Capital Gainloss Easy SQL, Python
1525 Number of Good Ways to Split a String Medium Python
1527 Patients With a Condition Easy SQL
1528 Kids With The Greatest Number Of Candies Easy Python, Python
1541 Top Travellers Easy SQL
1542 Consecutive Characters Easy Python
1544 Count Good Nodes in Binary Tree Medium Python
1547 Destination City Easy Python
1550 Three Consecutive Odds Easy Python
1551 Minimum Operations to Make Array Equal Medium Python
1552 Build an Array With Stack Operations Medium Python
1557 Check If a String Contains All Binary Codes of Size K Medium Python
1560 Number of Students Doing Homework at a Given Time Easy Python
1566 Check If a Word Occurs As a Prefix of Any Word in a Sentence Easy Python
1567 Maximum Length of Subarray With Positive Product Medium Python
1570 Final Prices With a Special Discount in a Shop Easy Python
1572 Matrix Diagonal Sum Easy Python
1574 Maximum Product of Two Elements in an Array Easy Python
1578 Minimum Time to Make Rope Colorful Medium Python
1580 Shuffle the Array Easy Python
1581 Customer Who Visited but Did Not Make Any Transactions Easy SQL
1584 Average Salary Excluding the Minimum and Maximum Salary Easy Python
1587 Bank Account Summary II Easy SQL
1588 Sum of All Odd Length Subarrays Easy Python
1603 Design Parking System Easy Python, Python
1605 Find Valid Matrix Given Row and Column Sums Medium Python
1609 Even Odd Tree Medium Python notes
1616 Minimum Difference Between Largest and Smallest Value in Three Moves Medium Python
1625 Group Sold Products By The Date Easy SQL
1626 Can Make Arithmetic Progression From Sequence Easy Python
1630 Count Odd Numbers in an Interval Range Easy Python
1632 Number of Good Ways to Split a String Medium Python
1635 Number of Good Pairs Easy Python
1636 Sort Array by Increasing Frequency Easy Python
1641 Count Sorted Vowel Strings Medium Python
1646 Get Maximum in Generated Array Easy Python
1651 Shuffle String Easy Python
1662 Check If Two String Arrays are Equivalent Easy Python
1667 Fix Names in a Table Easy SQL
1670 Patients With a Condition Easy SQL
1672 Richest Customer Wealth Easy Python
1674 Minimum Operations to Make Array Equal Medium Python
1677 Matrix Diagonal Sum Easy Python
1678 Goal Parser Interpretation Easy Python
1684 Count the Number of Consistent Strings Easy Python
1688 Count of Matches in Tournament Easy Python
1690 Maximum Length of Subarray With Positive Product Medium Python
1693 Daily Leads and Partners Easy SQL, Python
1700 Minimum Time to Make Rope Colorful Medium Python
1704 Determine if String Halves Are Alike Easy Python
1708 Design Parking System Easy Python
1711 Find Valid Matrix Given Row and Column Sums Medium Python
1724 Customer Who Visited but Did Not Make Any Transactions Easy SQL
1729 Find Followers Count Easy SQL
1731 Even Odd Tree Medium Python
1734 Bank Account Summary II Easy SQL
1741 Find Total Time Spent by Each Employee Easy SQL, Python
1742 Maximum Number of Balls in a Box Easy Python
1748 Sum of Unique Elements Easy Python
1757 Recyclable and Low Fat Products Easy SQL
1761 Count Sorted Vowel Strings Medium Python
1768 Merge Strings Alternately Easy Python
1769 Get Maximum in Generated Array Easy Python
1773 Count Items Matching a Rule Easy Python
1779 Find Nearest Point That Has the Same X or Y Coordinate Easy Python
1781 Check If Two String Arrays are Equivalent Easy Python
1786 Count the Number of Consistent Strings Easy Python
1790 Check if One String Swap Can Make Strings Equal Easy Python
1791 Richest Customer Wealth Easy Python
1795 Rearrange Products Table Easy SQL
1797 Goal Parser Interpretation Easy Python
1806 Count of Matches in Tournament Easy Python
1811 Fix Names in a Table Easy SQL
1812 Determine Color of a Chessboard Square Easy Python
1816 Truncate Sentence Easy Python
1822 Sign of the Product of an Array Easy Python
1823 Determine if String Halves Are Alike Easy Python
1832 Check if the Sentence Is Pangram Easy Python
1833 Find the Highest Altitude Easy Python
1837 Daily Leads And Partners Easy SQL, Python
1844 Maximum Number Of Balls In A Box Easy Python, Python
1848 Sum of Unique Elements Easy Python
1859 Sorting the Sentence Easy Python
1873 Calculate Special Bonus Easy SQL
1876 Substrings of Size Three with Distinct Characters Easy Python
1877 Find Followers Count Medium SQL, Python
1880 Check if Word Equals Summation of Two Words Easy Python
1888 Find Nearest Point That Has the Same X or Y Coordinate Easy Python
1890 The Latest Login in 2020 Easy SQL
1892 Find Total Time Spent by Each Employee Easy SQL
1894 Merge Strings Alternately Easy Python
1899 Count Items Matching a Rule Easy Python
1908 Recyclable and Low Fat Products Easy SQL
1913 Maximum Product Difference Between Two Pairs Easy Python
1915 Check if One String Swap Can Make Strings Equal Easy Python
1920 Build Array from Permutation Easy Python, Python
1925 Count Square Sum Triples Easy Python
1929 Concatenation of Array Easy Python
1935 Maximum Number of Words You Can Type Easy Python
1941 Check if All Characters Have Equal Number of Occurrences Easy Python
1944 Truncate Sentence Easy Python
1948 Rearrange Products Table Easy SQL
1950 Sign of the Product of an Array Easy Python
1954 Replace All Digits with Characters Easy Python
1960 Check if the Sentence Is Pangram Easy Python
1965 Employees With Missing Information Easy SQL, Python
1967 Number of Strings That Appear as Substrings in Word Easy Python
1970 Sorting the Sentence Easy Python
1979 Find Greatest Common Divisor of Array Easy Python
1987 Substrings of Size Three with Distinct Characters Easy Python
1988 Minimize Maximum Pair Sum in Array Medium Python
2000 Reverse Prefix of Word Easy Python
2006 Count Number of Pairs With Absolute Difference K Easy Python
2010 Check if Word Equals Summation of Two Words Easy Python
2011 Final Value of Variable After Performing Operations Easy Python
2016 Maximum Difference Between Increasing Elements Easy Python
2023 Number of Pairs of Strings With Concatenation Equal to Target Medium Python
2024 Calculate Special Bonus Easy SQL
2032 Two Out of Three Easy Python
2037 Count Square Sum Triples Easy Python
2041 The Latest Login in 2020 Easy SQL
2042 Check if Numbers Are Ascending in a Sentence Easy Python, Python
2048 Build Array from Permutation Easy Python
2053 Check If All Characters Have Equal Number Of Occurrences Easy Python, Python
2057 Smallest Index With Equal Value Easy Python
2058 Concatenation of Array Easy Python
2062 Count Vowel Substrings of a String Easy Python
2073 Time Needed to Buy Tickets Easy Python
2078 Two Furthest Houses With Different Colors Easy Python
2085 Count Common Words With One Occurrence Easy Python
2089 Find Target Indices After Sorting Array Easy Python
2099 Number of Strings That Appear as Substrings in Word Easy Python
2106 Find Greatest Common Divisor of Array Easy Python
2108 Find First Palindromic String in the Array Easy Python
2110 Employees With Missing Information Easy SQL
2114 Maximum Number of Words Found in Sentences Easy Python
2116 Count Number of Pairs With Absolute Difference K Easy Python
2119 A Number After a Double Reversal Easy Python
2124 Check if All A's Appears Before All B's Easy Python
2128 Reverse Prefix of Word Easy Python
2129 Capitalize the Title Easy Python
2133 Check if Every Row and Column Contains All Numbers Easy Python, Python
2137 Final Value of Variable After Performing Operations Easy Python
2144 Maximum Difference Between Increasing Elements Easy Python
2154 Keep Multiplying Found Values by Two Easy Python
2159 Two Out of Three Easy Python
2160 Minimum Sum of Four Digit Number After Splitting Digits Easy Python notes
2163 Kth Distinct String in an Array Easy Python
2164 Sort Even and Odd Indices Independently Easy Python notes
2168 Check if Numbers Are Ascending in a Sentence Easy Python
2169 Count Operations to Obtain Zero Easy Python
2176 Count Equal and Divisible Pairs in an Array Easy Python
2180 Count Integers With Even Digit Sum Easy Python
2181 Merge Nodes in Between Zeros Medium Python, Python
2185 Counting Words With a Given Prefix Easy Python
2186 Count Vowel Substrings of a String Easy Python
2190 Count Common Words With One Occurrence Easy Python
2194 Cells in a Range on an Excel Sheet Easy Python
2195 Time Needed to Buy Tickets Easy Python
2199 Two Furthest Houses With Different Colors Easy Python
2206 Divide Array Into Equal Pairs Easy Python
2210 Find Target Indices After Sorting Array Easy Python
2215 Find the Difference of Two Arrays Easy Python
2219 Maximum Number of Words Found in Sentences Easy Python
2220 Minimum Bit Flips to Convert Number Easy Python
2221 Find Triangular Sum of an Array Medium Python
2231 Find First Palindromic String in the Array Easy Python
2235 Add Two Integers Easy Python, Python
2236 Root Equals Sum of Children Easy Python
2238 A Number After a Double Reversal Easy Python
2243 Check if All A's Appears Before All B's Easy Python
2248 Intersection of Multiple Arrays Easy Python
2254 Check if Every Row and Column Contains All Numbers Easy Python
2255 Count Prefixes of a Given String Easy Python
2264 Largest 3-Same-Digit Number in String Easy Python, Python
2265 Count Nodes Equal to Average of Subtree Medium Python
2266 Count Number of Texts Medium Python
2267 Check if There Is a Valid Parentheses String Path Hard Python
2269 Find the K-Beauty of a Number Easy Python
2270 Number of Ways to Split Array Medium Python
2274 Keep Multiplying Found Values by Two Easy Python
2277 Count Equal and Divisible Pairs in an Array Easy Python
2278 Percentage of Letter in String Easy Python
2283 Check if Number Has Equal Digit Count and Digit Value Easy Python, Python
2284 Sender With Largest Word Count Medium Python
2285 Maximum Total Importance of Roads Medium Python
2288 Count Operations to Obtain Zero Easy Python
2292 Counting Words With a Given Prefix Easy Python
2298 Count Integers With Even Digit Sum Easy Python
2299 Merge Nodes In Between Zeros Easy Python, Python
2304 Cells in a Range on an Excel Sheet Easy Python
2308 Divide Array Into Equal Pairs Easy Python
2309 Greatest English Letter in Upper and Lower Case Easy Python
2323 Minimum Bit Flips to Convert Number Easy Python
2324 Find Triangular Sum of an Array Medium Python
2325 Decode the Message Easy Python
2331 Intersection of Multiple Arrays Easy Python
2341 Count Prefixes Of A Given String Easy Python, Python
2346 Largest 3-Same-Digit Number in String Easy Python
2347 Count Nodes Equal to Average of Subtree Medium Python
2348 Count Number of Texts Medium Python
2349 Check if There Is a Valid Parentheses String Path Hard Python
2351 First Letter to Appear Twice Easy Python
2352 Equal Row and Column Pairs Medium Python
2357 Make Array Zero by Subtracting Equal Amounts Easy Python
2358 Number of Ways to Split Array Medium Python
2363 Merge Similar Items Easy Python
2365 Percentage of Letter in String Easy Python
2367 Number of Arithmetic Triplets Easy Python
2377 Check if Number Has Equal Digit Count and Digit Value Easy Python
2378 Sender With Largest Word Count Medium Python
2379 Maximum Total Importance of Roads Medium Python
2383 Add Two Integers Easy Python
2384 Root Equals Sum of Children Easy Python
2391 Strong Password Checker II Easy Python
2396 Strictly Palindromic Number Medium Python
2405 Optimal Partition of String Medium Python
2406 Decode the Message Easy Python
2413 Smallest Even Multiple Easy Python
2418 Sort the People Easy Python
2421 Maximum Number of Pairs in Array Easy Python
2427 First Letter To Appear Twice Easy Python, Python
2428 Equal Row and Column Pairs Medium Python
2436 Make Array Zero by Subtracting Equal Amounts Easy Python
2442 Number of Arithmetic Triplets Easy Python
2447 Merge Similar Items Easy Python
2481 Strictly Palindromic Number Medium Python
2487 Optimal Partition of String Medium Python
2491 Smallest Even Multiple Easy Python
2502 Sort the People Easy Python
2507 Number of Common Factors Easy Python
2556 Convert the Temperature Easy Python

Reference

About

LeetCode Problems & Solutions

Topics

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages