Veeraj’s Substack

Veeraj’s Substack

Share this post

Veeraj’s Substack
Veeraj’s Substack
Important Tricks and Pattern Recognition Techniques in DSA

Important Tricks and Pattern Recognition Techniques in DSA

Veeraj Kantilal Gadda's avatar
Veeraj Kantilal Gadda
Aug 20, 2025
∙ Paid
2

Share this post

Veeraj’s Substack
Veeraj’s Substack
Important Tricks and Pattern Recognition Techniques in DSA
Share

Step 1 – Start with Constraints

🔹 Small Input Size (n ≤ 20)

PROBLEM EXAMPLES :

  • Subsets (78) → Use recursion (take/not-take).

    • Trick: Think in terms of decision tree.

  • Permutations (46) → Swap elements during recursion.

    • Trick: Fix one element at a time, recurse on the rest.

  • Combination Sum (39) → DFS/backtracking.

    • Trick: Use “start index” to avoid duplicates.

  • Word…

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