Index

Module 08 · DSAWorked problems, in English

Clinic #30: Rotate Image

Pattern: Matrix / math · LC 48

Arrays and Strings
Arrays and Strings · Open board

Shows one row of same-size boxes, and two fingers walking that row from both ends toward the middle. This clinic stacks those rows into a square, and the two fingers turn out to be half of the answer.

Before you start. Arrays & Strings gave you a row of numbered boxes, where you can reach any box by its number without walking past the others, and a trick for reversing the row: one finger at each end, swap, step both inward, stop when they meet. The only other thing you need is that the counting starts at 0, so the first box in a row of three is box 0 and the last is box 2.

Continue reading with a plan

The first three lessons of every track are free. This lesson is included with a plan, which unlocks every lesson, board, video, lab and paper for one price.

View plans →Already a member? Sign in

Review DSA →

Saved in this browser, and to your account when you sign in.