"Talk is cheap. Show me the code." -Linus Torvalds
This repository serves as a centralized collection of my LeetCode solutions and Data Structures & Algorithms (DSA) implementations, written exclusively in Golang.
The focus of this project is not just to solve problems, but to write production-grade, idiomatic Go code.
- Idiomatic Go: Utilizes extensive use of Pointers, Interfaces, and Structs.
- Concurrency Patterns: Solutions involving Goroutines, Channels, and Mutexes where applicable.
-
Performance: Detailed Time (
$O$ ) and Space ($O$ ) complexity analysis for every solution. -
Unit Testing: Comprehensive
_test.gofiles for robust verification.
The codebase is organized by algorithmic patterns to facilitate easy navigation and learning:
π¦ GO-LEETCODE
β£ π arrays # Two Pointers, Sliding Window
β£ π strings # String Manipulation, Hashing
β£ π linked-list # Fast/Slow Pointers, Reversal
β£ π trees # DFS, BFS, BST Logic
β£ π concurrency # Goroutines, WaitGroups, Channels
β£ π dynamic-prog # Memoization & Tabulation
β π README.md
| # | Problem Name | Pattern | Difficulty | Time Complexity | Space Complexity |
|---|---|---|---|---|---|
| 1 | Longest Substring Without Repeating Characters | Sliding Window | π Medium | ||
| 2 | Two Sum | Hash Map | π’ Easy | ||
| 3 | Merge k Sorted Lists | Heap / D&C | π΄ Hard |
Tech Stack
- Language: Golang (1.26.0)
- Testing: Native go test framework
- Linting: golangci-lint
π How to Run To run the solution for a specific problem or package:
git clone [https://github.com/ghosthouse7/GO-LEETCODE.git](https://github.com/ghosthouse7/GO-LEETCODE.git)
# Navigate to the directory
cd GO-LEETCODE
# Run tests for a specific package (e.g., strings)
go test -v ./strings
π€ Contribution & Connect
I welcome discussions on code optimization and alternative approaches.
If you find a bug or have a more optimized solution (O(1) space, anyone?), feel free to open a Pull Request.
Author: ghost_hunter
GitHub: ghosthouse7
Crafted with β€οΈ and code by ghost_hunter