A curated list of awesome solutions to problems from LeetCode.com Special thanks to GeekForGeeks.com for all the helpful videos and notes to solve these problems.
This is just my attempt to solve the various problems from LeetCode.com and it is far from perfect and would need optimizing to reduce the complexities, but it's a start. All code is in C# only. For now.
# | Title | Test Cases Passed | Difficulty | Media |
---|---|---|---|---|
1 | Two Sum | ALL | ||
2 | Add Two Numbers | ALL | ||
3 | Longest Substring Without Repeating Characters | ALL | ||
4 | Median of Two Sorted Arrays | ALL | ||
5 | Longest Palindromic Substring | 49/92 | ||
6 | ZigZag Conversion | ALL | ||
7 | Reverse Integer | ALL | ||
8 | String to Integer(atoi) | ALL | ||
9 | Palindrome Number | ALL | ||
10 | Regular Expression Matching | (362/445) | ||
11 | Container With Most Water | ALL | ||
12 | Integer to Roman | ALL | ||
13 | Roman to Integer | ALL | ||
14 | Longest Common Prefix | NA | ||
15 | 3Sum | 226/313 | ||
16 | 3Sum Closest | NA | ||
17 | Letter Combinations of a Phone Number | ALL | ||
18 | 4Sum | NA | ||
19 | Remove Nth Node From End of List | 194/208 | ||
20 | Valid Parentheses | ALL | ||
21 | Merge Two Sorted Lists | ALL | ||
22 | Generate Parentheses | NA | ||
23 | Merge k Sorted Lists | ALL | ||
24 | Swap Nodes in Pairs | ALL | ||
25 | Reverse Nodes in k-Group | ALL | ||
26 | Remove Duplicates from Sorted Array | ALL | ||
27 | Remove Element | ALL | ||
28 | Implement strStr | NA | ||
29 | Divide Two Integers | ALL | ||
30 | Substring with Concatenation of All Words | 23/169 | ||
31 | Next Permutation | NA | ||
32 | Longest Valid Parentheses | ALL | ||
33 | Search in Rotated Sorted Array | ALL | ||
34 | Search for a Range | ALL | ||
35 | Search Insert Position | NA | ||
36 | Valid Sudoku | ALL | ||
37 | Sudoku Solver | NA | ||
38 | Count and Say | NA | ||
39 | Combination Sum | NA | ||
40 | Combination Sum II | NA | ||
41 | First Missing Positive | NA | ||
42 | Trapping Rain Water | NA | ||
43 | Multiply Strings | ALL | ||
44 | Wildcard Matching | NA | ||
45 | Jump Game II | ALL | ||
46 | Permutations | NA | ||
47 | Permutations II | NA | ||
48 | Rotate Image | NA | ||
49 | Group Anagrams | NA | ||
50 | Pow(x, n) | ALL | ||
51 | N-Queens | 5/9 | ||
52 | N-Queens II | NA | ||
53 | Maximum Subarray | NA | ||
54 | Spiral Matrix | ALL | ||
55 | Jump Game | ALL | ||
56 | Merge Intervals | NA | ||
57 | Insert Interval | NA | ||
58 | Length of Last Word | NA | ||
59 | Spiral Matrix II | NA | ||
60 | Permutation Sequence | NA | ||
61 | Rotate List | NA | ||
62 | Unique Paths | ALL | ||
63 | Unique Paths II | NA | ||
64 | Minimum Path Sum | NA | ||
65 | Valid Number | NA | ||
66 | Plus One | NA | ||
67 | Add Binary | NA | ||
68 | Text Justification | NA | ||
69 | Sqrt(x) | NA | ||
70 | Climbing Stairs | ALL | ||
71 | Simplify Path | NA | ||
72 | Edit Distance | 548/1520 | ||
74 | Search a 2D Matrix | ALL | ||
88 | Merge Sorted Array | ALL | ||
94 | Binary Tree Inorder Traversal | ALL | ||
127 | Word Ladder | 17/39 | ||
207 | Course Schedule | 35/42 | ||
226 | Inverted Binary Tree | ALL | ||
412 | Fizz Buzz | ALL | ||
564 | Find the Closest Palindrome | ALL | ||
617 | Merge Two Binary Trees | ALL | ||
1000 | BestPathAcrossMatrix | ALL | ||
1001 | RecurringCharacter | ALL | ||
1002 | PositiveNegitiveSegregation | ALL | ||
1003 | Remove Duplicates Linkedlist | ALL | ||
1004 | Trie Data Structure | ALL | ||
1005 | Adding Binary Numbers | ALL |