AP CSA FRQ Guide
2014 FRQ 1: ScrambleWord
Scramble a word by swapping selected adjacent characters and then update a list by replacing or removing words based on whether they change.
String Processing and List Mutation22 minute targetStringArrayListsubstringmutation
Skills Tested
What this FRQ is really practicing
StringArrayListsubstringmutation
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: scan adjacent pairs and perform the prompt-specific swap rule.
- 2Part B: update list entries that change and remove entries that stay the same.
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
Swapping overlapping pairs.
Removing while moving forward without adjusting the index.
Using == to compare the original and scrambled words.
Self Check
Review questions before you submit
Scans adjacent characters.
The decision depends on character k and character k + 1.
Rebuilds the string after a swap.
Strings are immutable.
Uses set for changed words and remove for unchanged words.
The list-processing method both replaces and removes.
Avoids reusing a character immediately after a swap.
After swapping adjacent characters, advance past both positions.
Practice Links
