This repository contains implementations of Data Structures, Algorithms and Leetcode in Go.
- Bubble sort 🔗 Learn more
- Insertion sort 🔗 Learn more
- Selection sort 🔗 Learn more
- Merge sort 🔗 Learn more
- Quick sort 🔗 Learn more
- Heap sort 🔗 Learn more
- Counting sort 🔗 Learn more
- Array
- ✅ (++)(50/75) 238. Product of Array Except Self
- hash map / hash tables
- ✅ (+++)(50/75) 1. Two Sum
- ✅ (+++)(50) 49. Group Anagrams
- ✅ (++) 560. Subarray Sum Equals K 📝 medium-difficult
- Stack
- ✅ (++) 496. next greater element I
- ✅ (++)(50/75) 20. Valid Parentheses
- ✅ (+++)(50/75) 206. Reverse Linked List
- ✅ (++) 739. Daily temperatures
- Two pointers
- ✅ (++) 82. remove duplicates from sorted list II
- ✅ (++)(50/75) 11. container with most water
- ✅ (++)(50/75) 15. 3 Sum problem
- ✅ (++)(75) 75. Sort Colors
- ✅ (++) 80. Remove Duplicates from Sorted Array II
- sliding window
- ✅ (++)(50/75) 3. Longest Substring Without Repeating Characters
- ✅ (++)(50/75) 76. Minimum window substring
- ✅ (++) 209. Minimum Size Subarray Sum
- ✅ (+++)(50) 424. Longest Repeating Character Replacement
- Linked List
- ✅ (++) 2. Add Two Numbers
- ✅ (75) 21. Merge Two Sorted Lists
- ✅ (+++)(50/75) 23. Merge k Sorted Lists
- ✅ (++)(50/75) 141. Linked List Cycle
- binary search
- ✅ (++++)(75) 33. Search in Rotated Sorted Array
- (++) 34. Find in sorted array
- ✅ (++++)(50) 153. Find Minimum in Rotated Sorted Array
- (++) 349. Intersection of two arrays
- (++) 658. Find K closest elements
- Binary Search tree
- ✅ (++)(50/75) 235. lowest common ancestor of a binary search tree
- ✅ 450. delete node in a BST
- ✅ (+++)(50/75) 98. validate binary search tree
- (+++) 108. convert sorted arry to binary search tree
- Binary tree
- (++) 101. Symmetric Tree
- ✅ (+++)(50/75) 105. Construct Binary Tree from Preorder and Inorder Traversal
- (++) 112. path sum
- ✅ (++)(50) 124. binary tree maximum path sum
- ✅ (++)(50/75) 297. Serialize and Deserialize Binary Tree
- (++)(75) 543. Diameter of binary tree
- (++) 979. Distribute Coins in Binary Tree
- (++)(75) 104. Maximum Depth of Binary Tree
- (++)(75) 102. Binary Tree Level Order Traversal
- ✅ (++)(50/75) 226. Invert Binary Tree
- trie
-
- design in-memory file system
- (placeholder) 212. Word search II
-
- Heap, priority queue
- TODO
- Interval
- ✅ (++)(50/75) 56. Merge Intervals 📝 easy
- ✅ (++)(50/75) 57. Insert Interval 📝 easy
- ✅ (++)(50) 435. Non-overlapping Intervals 📝 medium
- (++) 986. interval list intersections
- Greedy
- TODO
- Backtracking
- (++)(75) 46. Permutations I
- ✅ (++)(75) 79. Word search I
- ✅ (++)(50) 212. Word search II
- (++) 22. Generate Parentheses
- graph
- (++)(75) 127. word ladder
- ✅ (++)(50/75) 133. Clone Graph
- ✅ (+++)(50/75) 200. Number of Islands
- ✅ (++)(50) 417. Pacific Atlantic Water Flow
- Sort
- ✅ (++)(50) 347. Top K Frequent Elements
- matrix
- (++)(75) 54. Spiral Matrix
- N-ary tree
-
- serialize and deserialize N-ary tree
-
- String
- (++) 539. Minimum Time Difference
- dynamic programming
- ✅ 509. Fibonacci Number
- ✅ (++)(50/75) 70. Climbing Stairs
- ✅ (+++)(50/75) 62. Unique Paths I
- ✅ (++) 63. Unique Paths II
- (++)(50) 91. decode ways
- ✅ (+++)(50/75) 139. Word Break 📝 a bit tricky
- (++)(50) 377. Combination Sum IV
- ✅ (+++)(50/75) 53. Maximum Subarray
- (+++)(50) 300. Longest Increasing Subsequence
- (++) 152. maximum product subarray
- ✅ (+++)(50/75) 322. coin change 📝 a bit difficult to understand the idea
- (+++)(50) 55. jump game
- ✅ (+++)(50/75) 121. best time to buy and sell stock 📝 very easy, don't overthink it
- (++) 122. best time to buy and sell stock II
- (++)(50) 198. House Robber
- (++)(50) 213. House Robber II
- union find
-
- number of provinces
-
- graph valid tree
-
- blind
- (75) 125. Valid Palindrome
- ✅ (50/75) 242. Valid Anagram 📝 easy
- (75) 704. Binary Search
- (75) 733. Flood Fill
- (75) 110. Balanced Binary Tree
- (75) 232. Implement Queue using Stacks
- (75) 278. First Bad Version
- (75) 383. Ransom Note
- (75) 409. Longest Palindrome
- (75) 169. Majority Element
- (75) 67. Add Binary
- (75) 876. Middle of the Linked List
- ✅ (50/75) 217. Contains Duplicate 📝 super easy
- (75) 542. 01 Matrix
- (75) 973. K closet points to origin
- (75) 150. Evaluate Reverse Polish Notation
- ✅ (50/75) 207. Course Schedule 📝 medium, worth to visit again
- ✅ (50/75) 208. Implement Trie (Prefix Tree) 📝 easy
- (75) 155. Min Stack
- (75) 994. Rotting Oranges
- (75) 39. Combination Sum
- (75) 236. Lowest Common Ancestor of a Binary Tree
- (75) 981. Time Based Key-Value Store
- (75) 721. Accounts Merge
- (75) 416. Partition Equal Subset Sum
- (75) 8. String to Integer (atoi)
- (75) 78. Subsets
- (75) 199. Binary Tree Right Side View
- (75) 5. Longest Palindromic Substring
- (75) 17. Letter Combinations of a Phone Number
- (75) 438. Find All Anagrams in a String
- (75) 310. Minimum Height Trees
- (75) 621. Task Scheduler
- (75) 146. LRU Cache
- ✅ (50/75) 230. Kth Smallest Element in a BST 📝 medium, worth to re-visit
- (75) 42. Trapping Rain Water
- ✅ (50/75) 295. Find Median from Data Stream 📝 hard, worth to re-visit
- (75) 224. Basic Calculator
- (75) 1235. Maximum Profit in Job Scheduling
- (75) 84. Largest Rectangle in Histogram
- (50) 19. Remove Nth Node From End of List
- (50) 647. Palindromic Substrings
- (50) 211. Design Add and Search Words Data Structure
- (50) 128. Longest Consecutive Sequence