2D arrays, DFS recursion, BFS shortest path, and CCC Q5 patterns
2D arrays, the four-directions pattern, DFS recursion template, and BFS queue template.
Sum all values in a 2D grid using nested loops.
Return the (row, col) of the first occurrence of a target value in a grid.
Count how many of the 4 adjacent cells equal a target value — uses the directions pattern.
Recursively paint all connected cells of the same color — your first DFS.
Count separate connected groups of a target value using DFS — the classic islands problem.
Return True if a path exists from top-left to bottom-right in a maze using DFS.
Find the minimum number of steps from top-left to bottom-right using BFS.
Boundary checks, visited sets, DFS vs BFS cheat sheet, and common mistakes.