This repository contains my solutions to LeetCode problems, organized by programming language and algorithmic patterns. The goals are to strengthen Data Structures & Algorithms (DSA), write clean and efficient code, and maintain fluency across multiple languages for technical interviews.
.
├── java/
│ ├── src/
│ │ └── main/
│ │ └── com/
│ │ └── pedrojardim/
│ │ └── leetcode/
│ │ ├── arrays/
│ │ ├── binarysearch/
│ │ ├── strings/
│ │ ├── hashmap_set/
│ │ ├── stacks_queues/
│ │ ├── linkedlists/
│ │ ├── trees/
│ │ ├── graphs/
│ │ ├── heaps/
│ │ ├── intervals/
│ │ ├── backtracking/
│ │ └── dynamic_programming/
│ └── README.md
├── go/
│ ├── arrays/
│ ├── binarysearch/
│ ├── strings/
│ ├── hashmap_set/
│ ├── stacks_queues/
│ ├── linkedlists/
│ ├── trees/
│ ├── graphs/
│ ├── heaps/
│ ├── intervals/
│ ├── backtracking/
│ └── dynamic_programming/
│ └── README.md
├── javascript/
│ ├── arrays/
│ ├── binarysearch/
│ ├── strings/
│ ├── hashmap_set/
│ ├── stacks_queues/
│ ├── linkedlists/
│ ├── trees/
│ ├── graphs/
│ ├── heaps/
│ ├── intervals/
│ ├── backtracking/
│ └── dynamic_programming/
│ └── README.md
├── python/
│ ├── arrays/
│ ├── binarysearch/
│ ├── strings/
│ ├── hashmap_set/
│ ├── stacks_queues/
│ ├── linkedlists/
│ ├── trees/
│ ├── graphs/
│ ├── heaps/
│ ├── intervals/
│ ├── backtracking/
│ └── dynamic_programming/
│ └── README.md
└── README.md
Within each language folder, problems are grouped by algorithmic pattern (e.g., arrays, graphs, dynamic_programming). Each solution typically includes:
- The solution code
- Brief explanation and approach notes
- Time/space complexity (Big-O)
- Link to the original LeetCode problem
- Java (primary): Streams, lambdas, Optional, modern Java (11–21), clean OOP
- TypeScript/JavaScript: ES6+, clarity and performance
- Go: Concurrency (goroutines/channels), idiomatic error handling
- Python: Concise and “pythonic” solutions
- Arrays & Strings (Two Pointers, Sliding Window, Prefix Sum)
- Hash Maps & Sets
- Stacks & Queues (including Monotonic Stack)
- Binary Search (and variations)
- Linked Lists
- Trees (DFS, BFS, BST)
- Graphs (DFS, BFS, topological sort, shortest path)
- Heaps & Priority Queues
- Intervals
- Backtracking
- Dynamic Programming (memoization, tabulation)
- Browse by language and then by pattern
- File names mirror problem names when possible (e.g.,
TwoSum.java,longest_substring_without_repeating_characters.go) - Each language directory may contain its own README with details and tips
Examples (Java):
# Navigate to the Java solution folder
cd java/src/main/com/pedrojardim/leetcode/arrays
javac TwoSum.java
java TwoSumIf tests are configured:
mvn test
# or
gradle test- Consistent practice (NeetCode 150, blind 75, patterns-first)
- Refactor to idiomatic solutions after passing
- Add notes on trade-offs and alternative approaches
- LeetCode: https://leetcode.com/
- NeetCode: https://neetcode.io/
- Big-O Cheatsheet: https://www.bigocheatsheet.com/
- LinkedIn: https://www.linkedin.com/in/pdrdjardim/
- GitHub: https://github.com/pjardim
This repository is for personal study. Feel free to read and learn from it. If you find issues or have suggestions, open an issue or PR.
If you want, I can also generate a minimal README template for each language directory to keep everything consistent.