Competitive Programming

LeetCode Solutions

Curated LeetCode write-ups with original summaries, pattern recognition, and clean C++ implementations aimed at interview preparation. This branch sits between the DSA notebook and the harder contest archives: the emphasis is clarity, reusable patterns, and recruiter-friendly code. Official LeetCode problems are linked on every page instead of being mirrored here.

8 published solutions
8 active categories
1 easy / 7 medium / 0 hard difficulty mix
May 21, 2026 most recently updated page

Begin with the baseline interview patterns

The first batch is intentionally small. It covers the common array, pointer, stack, traversal, and DP patterns that recur in interviews.

Arrays

Two Sum

Start with the complement lookup pattern, then move into sorted-pair and sliding-window variants.

Easy arrayhash mapcomplement lookup

Pattern-first archive categories

Each category groups problems by the main interview pattern, not by difficulty alone. Only completed write-ups appear as public category pages.

Arrays 1 solved
01

Hash-map lookups, prefix-style scans, and the baseline decisions that show up in almost every interview loop.

  • Focus: one-pass scans and complement lookups
  • Difficulties: 1 easy / 0 medium / 0 hard
  • Two Sum
Two Pointers 1 solved
02

Sorted-array pairing, duplicate control, and shrinking a search space from both ends.

  • Focus: sorted scans and duplicate handling
  • Difficulties: 0 easy / 1 medium / 0 hard
  • 3Sum
Sliding Window 1 solved
03

Grow and shrink a window while maintaining an invariant instead of restarting every substring check.

  • Focus: window invariants and frequency tracking
  • Difficulties: 0 easy / 1 medium / 0 hard
  • Longest Substring Without Repeating Characters
Binary Search 1 solved
04

Classic sorted-array search plus binary search on a monotone feasibility answer.

  • Focus: monotone predicates and answer search
  • Difficulties: 0 easy / 1 medium / 0 hard
  • Koko Eating Bananas
Stack 1 solved
05

Monotonic structures and deferred answers for next-greater and range-style problems.

  • Focus: monotonic stack reasoning
  • Difficulties: 0 easy / 1 medium / 0 hard
  • Daily Temperatures
Graph 1 solved
07

Connectivity, traversal, components, and graph state propagation.

  • Focus: DFS, BFS, and component thinking
  • Difficulties: 0 easy / 1 medium / 0 hard
  • Number of Islands
Tree 1 solved
08

Recursive structure, subtree information, and ancestor-style reasoning.

  • Focus: postorder recursion and tree invariants
  • Difficulties: 0 easy / 1 medium / 0 hard
  • Lowest Common Ancestor of a Binary Tree
Dynamic Programming 1 solved
09

State design, transition choices, and subproblem reuse without overcomplicating the implementation.

  • Focus: state compression and transition design
  • Difficulties: 0 easy / 1 medium / 0 hard
  • Coin Change

One practical order to study this section

This path optimizes for transfer. Each stage builds on recognition habits from the stage before it.

01 Build the scan baseline
3 stages

Start with one-pass array scans, then learn when sorting turns a quadratic search into a pointer walk.

Arrays -> Two Pointers -> Sliding Window

02 Add decision patterns
2 stages

Learn the two big interview accelerators: monotonic stacks for next-greater style queries and binary search on a monotone answer.

Stack -> Binary Search

03 Move into traversal
2 stages

Practice recursive and graph traversal patterns after the pointer-based problems feel routine.

Tree -> Graph

04 Finish with optimization
1 stage

Dynamic programming becomes much easier once the earlier recognition patterns are stable.

Dynamic Programming

Categories wired for future batches

These categories are part of the archive structure already, but they do not appear as public pages until they have finished solutions.

Heap: priority queues and partial ordering Backtracking: choice trees and pruning Greedy: exchange arguments and interval choices Bitmask: subset enumeration and state compression Advanced: multi-pattern design questions

Latest LeetCode solution pages

Each page keeps the official link, the rendered explanation, and the exact C++ source on one page.