AP CSA FRQ Guide
2010 FRQ 4: GridChecker
Find an actor with the most occupied neighboring locations and collect occupied locations within two rows and columns of a target location.
Legacy GridWorld Grid Analysis22 minute targetGridWorldArrayListgrid traversallegacy
Skills Tested
What this FRQ is really practicing
GridWorldArrayListgrid traversallegacy
Treat these skills as the study checklist. If any tag feels shaky, review that topic before attempting the full written response.
Starter Approach
How to begin without copying a solution
- 1Part A: inspect occupied locations and track the actor with the largest neighbor count.
- 2Part B: search a bounded row/column window around loc and return occupied locations other than loc.
Write a first attempt before revealing any solution outline. Most AP CSA FRQ progress comes from tracing your own code and finding the missing case.
Common Mistakes
Mistakes to watch for while writing
Counting empty adjacent locations as neighbors.
Including loc itself in the within-two result.
Searching outside the bounds of the grid.
Self Check
Review questions before you submit
Uses occupied locations from the grid.
GridWorld provides a helper for occupied locations.
Counts neighbors for each occupied actor.
Use adjacent occupied locations or neighbor helpers.
Handles an empty grid by returning null.
No actors means no best actor.
Checks row and column offsets within two.
The search window is at most two rows and two columns away.
Practice Links
