Veeraj’s Substack

Veeraj’s Substack

Share this post

Veeraj’s Substack
Veeraj’s Substack
DSA SUB PATTERNS AND PROBLEMS

DSA SUB PATTERNS AND PROBLEMS

Veeraj Kantilal Gadda's avatar
Veeraj Kantilal Gadda
Aug 11, 2025
∙ Paid
3

Share this post

Veeraj’s Substack
Veeraj’s Substack
DSA SUB PATTERNS AND PROBLEMS
1
Share

Detailed Sub-Patterns Explanation Guide

1. Two Pointers Patterns

1.1 Opposite Direction Two Pointers

Core Concept: Use two pointers starting from opposite ends of an array, moving them towards each other based on certain conditions.

Key Insights:

  • Usually works on sorted arrays or when you need to find pairs/triplets

  • Time Complexity: O(n) - much better than ne…

Keep reading with a 7-day free trial

Subscribe to Veeraj’s Substack to keep reading this post and get 7 days of free access to the full post archives.

Already a paid subscriber? Sign in
© 2025 Veeraj Kantilal Gadda
Privacy ∙ Terms ∙ Collection notice
Start writingGet the app
Substack is the home for great culture

Share