AP CSA FRQ Guide
2015 FRQ 1: DiverseArray
Write helper methods to sum arrays, produce row sums, and determine whether all row sums are different.
Skills Tested
What this FRQ is really practicing
Review these topics before attempting the problem.
Starter Approach
How to begin with your own plan
- 1Sum a one-dimensional array.
- 2Call the sum helper for each row of a 2D array.
- 3Detect duplicate row sums.
Attempt the problem before opening the solution.
Common Mistakes
Mistakes to watch for while writing
Self Check
Review questions before you submit
Traverses the whole one-dimensional array.
Use an enhanced for loop or indexed loop.
Uses arraySum when computing row sums.
The rowSums method should reuse the helper.
Creates an int[] for row sums.
The result length should match the number of rows.
Checks every pair of row sums for equality.
A nested loop over rowSums is a common solution.
Practice Links
