CoursesArray Patterns

Matrices

Lessons
9
Exercises
57
Minutes
54
  1. 1

    Working in Two Dimensions

    Read any cell with rows[r][c] and learn the four traversal moves every matrix problem builds on.

    Multiple choiceTap
    5 exercises
    4 min
  2. 2

    Transpose a Matrix

    Send every cell across the main diagonal — result[c][r] = matrix[r][c] — and see why the shape can change.

    Complete codeDebugMultiple choiceTap
    6 exercises
    5 min
  3. 3

    Matrix Diagonal Sum

    Sum both diagonals in one pass over the rows — and never count the center twice.

    Complete codeMultiple choiceTrace
    6 exercises
    5 min
  4. 4

    Set Matrix Zeroes

    Mark first, write later — mutating while you scan turns your own zeros into fake input.

    Complete codeMultiple choiceTrace
    6 exercises
    6 min
  5. 5

    Spiral Matrix

    Four shrinking boundaries walk the spiral — and a mid-loop re-check stops the double-walk.

    Code orderMultiple choiceTrace
    7 exercises
    6 min
  6. 6

    Valid Sudoku

    One pass, three memories: every filled cell reports to its row, its column, and its box.

    Complete codeMultiple choiceTap
    6 exercises
    6 min
  7. 7

    Matrices CheckpointCheckpoint

    No new concepts — combine the island's matrix tools: diagonal index rules, Sudoku box ids, transpose indexing, and mark-then-write discipline.

    DebugFill blankMultiple choiceTapTrace
    6 exercises
    6 min
  8. 8

    Matrices ReviewReview

    Mixed recap of the island: choosing the right matrix tool, diagonal overlap, spiral boundaries, mark-then-write, and seen-set checks.

    DebugCode orderFill blankMultiple choiceTapTrace
    7 exercises
    6 min
  9. 9

    Boss: Rotate ImageBoss

    Rotate an n x n matrix 90° clockwise in place: transpose across the main diagonal, THEN reverse each row — two passes, and the order is everything.

    Complete codeDebugCode orderMultiple choiceTrace
    8 exercises
    10 min
AlgoFox Pro

Array Patterns is part of AlgoFox Pro

You can read the whole course outline here. The exercises are in the app, along with your streak, your mistake review, and the progress that carries across your devices.

Pro starts with a 3 day free trial. The app store decides who is eligible for an introductory offer, and a lapsed subscription does not get another one.

Download AlgoFox on the App StoreGet AlgoFox on Google Play

Already subscribed in the app? Sign in with the same account and Pro works here too. Quick Play and Battle are free on the web, and so is the first course in every subject.