11 worked problems

Matrix

2-D traversal and in-place transforms. The input is a grid whose row, column, diagonal, or neighborhood geometry matters.

Recognition signal

When should you think of Matrix?

The input is a grid whose row, column, diagonal, or neighborhood geometry matters.

Core invariant

What must stay true?

Visited cells and boundary indices define the processed region without duplication.

Practice in a deliberate order

Starter

Build the template

  1. #463 Island PerimeterEasy
Stretch

Combine ideas under pressure

  1. No stretch problem is published yet.

What to learn in this cluster

  1. 01Boundary traversal
  2. 02In-place transforms
  3. 03Grid state simulation

All Matrix problems

11 of 11 walkthroughs
Continue the cluster

Related patterns and study guides