Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

5. Pattern: Two pointers (Subproblem)

This section covers subproblem-style two-pointer techniques where each step reduces a larger array problem into a smaller one.

Table of contents

  1. Identifying two pointer subproblem
  2. K rotations
  3. Three sum
  4. Approximate three sum
  5. Four sum