Try   HackMD

Two Pointers Study Guide

Basic Two Pointers

Same Direction Pointers

Problems where both pointers move in the same direction.

Opposite Direction Pointers

Problems where pointers start from opposite ends and move towards each other.

Advanced Two Pointers

Sliding Window

A variation of the two pointers technique for substring problems.

Fast and Slow Pointers

Problems involving detecting cycles or finding middle elements.

Multiple Pointers

Problems requiring more than two pointers.

Permutation-based

Problems involving permutations solved using two pointers.

Water Container Problems

A specific class of problems involving container capacities.

Complex Processing

Problems requiring more complex logic with two pointers.

Two Pointers in Different Data Structures

String Operations

Applying two pointers technique to string problems.

Problem Difficulty Legend

  • 🟩 Easy
  • 🟨 Medium
  • 🟧 Medium-Hard
  • 🟥 Hard
  • ⬛ Very Hard

Additional Resources