This repository contains my leetcode solutions to select questions.
Problem | Solutions | Time | Space |
---|---|---|---|
771. Jewels and Stones | Link | ||
217. Contains Duplicate | Link | ||
383. Ransom Note | Link | ||
242. Valid Anagram | Link | ||
1189. Maximum Number of Balloons | Link | ||
1. Two Sum | Link | ||
36. Valid Sudoku | Link | ||
49. Group Anagrams | Link | ||
169. Majority Element | Link | ||
128. Longest Consecutive Sequence | Link |
Problem | Solutions | Time | Space |
---|---|---|---|
977. Squares of a Sorted Array | Link | ||
344. Reverse String | Link | ||
167. Two Sum II - Input Array Is Sorted | Link | ||
125. Valid Palindrome | Link | ||
15. 3Sum | Link | ||
11. Container With Most Water | Link | ||
16. 3Sum Closest | Link | ||
18. 4Sum | Link |
Problem | Solutions | Time | Space |
---|---|---|---|
682. Baseball Game | Link | ||
20. Valid Parentheses | Link | ||
150. Evaluate Reverse Polish Notation | Link | ||
739. Daily Temperatures | Link | ||
155. Min Stack | Link |
Problem | Solutions | Time | Space |
---|---|---|---|
83. Remove Duplicates from Sorted List | Link | ||
2807. Insert Greatest Common Divisors in Linked List | Link | ||
206. Reverse Linked List | Link | ||
21. Merge Two Sorted Lists | Link | ||
141. Linked List Cycle | Link | ||
876. Middle of the Linked List | Link | ||
19. Remove Nth Node From End of List | Link | ||
138. Copy List with Random Pointer | Link |
Problem | Solutions | Time | Space |
---|---|---|---|
704. Binary Search | Link | ||
35. Search Insert Position | Link | ||
278. First Bad Version | Link | ||
367. Valid Perfect Square | Link | ||
74. Search a 2D Matrix | Link | ||
153. Find Minimum in Rotated Sorted Array | Link | ||
33. Search in Rotated Sorted Array | Link | ||
875. Koko Eating Bananas | Link |
Problem | Solutions | Time | Space |
---|---|---|---|
643. Maximum Average Subarray I | Link | ||
1004. Max Consecutive Ones III | Link | ||
3. Longest Substring Without Repeating Characters | Link | ||
424. Longest Repeating Character Replacement | Link | ||
209. Minimum Size Subarray Sum | Link | ||
567. Permutation in String | Link |
Problem | Solutions | Time | Space |
---|---|---|---|
226. Invert Binary Tree | Link | ||
104. Maximum Depth of Binary Tree | Link | ||
110. Balanced Binary Tree | Link | ||
543. Diameter of Binary Tree | Link | ||
100. Same Tree | Link | ||
101. Symmetric Tree | Link | ||
112. Path Sum | Link | ||
572. Subtree of Another Tree | Link | ||
102. Binary Tree Level Order Traversal (BFS) | Link | ||
637. Average of Levels in Binary Tree | Link | ||
230. Kth Smallest Element in a BST | Link | ||
530. Minimum Absolute Difference in BST | Link | ||
98. Validate Binary Search Tree | Link | ||
235. Lowest Common Ancestor of a Binary Search Tree | Link | ||
208. Implement Trie (Prefix Tree) | Link |
Note: No JavaScript
Problem | Solutions | Time | Space |
---|---|---|---|
1046. Last Stone Weight | Link | ||
215. Kth Largest Element in an Array | Link | ||
347. Top K Frequent Elements | Link | ||
973. K Closest Points to Origin | Link |
Problem | Solutions | Time | Space |
---|---|---|---|
78. Subsets | Link | ||
46. Permutations | Link | ||
77. Combinations | Link | ||
39. Combination Sum | Link | ||
17. Letter Combinations of a Phone Number | Link | ||
22. Generate Parentheses | Link | ||
45. Jump Game II | Link | ||
79. Word Search | Link |
Problem | Solutions | Time | Space |
---|---|---|---|
1971. Find if Path Exists in Graph | Link | ||
200. Number of Islands | Link | ||
695. Max Area of Island | Link | ||
207. Course Schedule (Detect Cycles in a Graph) | Link |