Checkpoint: run compression
Challenge on lesson: Checkpoint: collapse the runs
CHALLENGE
Difficulty: intermediate+25 XP
Implement String compress(String s): collapse each run of equal adjacent characters to one copy ("aabbbca" โ "abca"). Combine the run-boundary idea with the string accumulator; keep the first character unconditionally.
Press Submit to check your solution.
Back to lesson: Checkpoint: collapse the runs