Skip to content

Commit 5f64629

Browse files
authored
Merge pull request #8 from pertrai1/copilot/add-documentation-two-pointers
Add Two Pointers technique documentation
2 parents e56dc74 + 2a367ee commit 5f64629

File tree

2 files changed

+984
-0
lines changed

2 files changed

+984
-0
lines changed

docs/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,10 @@
77
- Maintain a window over an array/string while expanding and shrinking based on constraints.
88
- Used for longest substring problems, frequency constraints, and streaming aggregates.
99
- [Technique Details](techniques/SLIDING_WINDOW.md)
10+
11+
### Two Pointers Technique
12+
13+
- Use two pointers to traverse data structures efficiently, eliminating nested loops.
14+
- **Opposite Direction**: Pointers start at opposite ends and converge (e.g., Two Sum, palindrome checking).
15+
- **Same Direction**: Pointers move in parallel at different speeds (e.g., remove duplicates, fast/slow cycle detection).
16+
- [Technique Details](techniques/TWO_POINTERS.md)

0 commit comments

Comments
 (0)