Practice · 4 of 4
Checkpoint: two-method FRQ under contract
CHALLENGE
Difficulty: intermediate+25 XP
A complete Q1-style question: (a) int countWords(String s): words are maximal runs of non-space characters; s may have leading/trailing/multiple spaces; has 0 words. (b) String longestWord(String s): the longest word, earliest on ties ( returns ). Both from scratch — run the full eight-step workflow on paper first.
Press Submit to check your solution.
Back to lesson: Practice: FRQ fundamentals lab