AP CSA FRQ Guide
2017 FRQ 1: Digits
Build a Digits object from an integer and determine whether the stored digits are strictly increasing from left to right.
Skills Tested
What this FRQ is really practicing
Review these topics before attempting the problem.
Starter Approach
How to begin with your own plan
- 1Constructor: decompose the integer into digits while preserving left-to-right order.
- 2Method: compare adjacent values and return false as soon as the strict-increase rule fails.
Attempt the problem before opening the solution.
Common Mistakes
Mistakes to watch for while writing
Self Check
Review questions before you submit
Uses division or remainder to process digits.
A solution usually uses % 10 and / 10 or a string-based traversal.
Preserves the original digit order in the list.
If you peel from the right, insert at index 0 or reverse later.
Compares adjacent digit values.
Compare digit k with digit k + 1, not every pair.
Rejects equal or decreasing adjacent digits.
Strictly increasing means the next digit must be greater.
Practice Links
