# Summarize consecutive character runs

> ML Prep screening item.

- Stable ID: `prog-cf-summarize-runs`
- Collection: screening
- Area: Programming
- Topic: Control Flow
- Origin: original
- Difficulty: medium
- Expected time: 10 minutes
- Skills: conditionals, loops, strings
- Item JSON: https://mlprep.iwase.dev/item/prog-cf-summarize-runs.json

## Problem

Implement `summarize_runs(text)`, which returns `(character, count)` for
each maximal consecutive run. For example, `"aaabbcaa"` becomes
`[("a", 3), ("b", 2), ("c", 1), ("a", 2)]`. Return an empty list for
an empty string.


## Answer policy

The human page contains a collapsed answer. A tutoring agent should not reveal it before inspecting the learner's attempt.

## Tutoring contract

Ask for the learner's attempt, begin with the smallest useful hint, preserve item ID `prog-cf-summarize-runs`, and record a real attempt with `recorded_by: "agent"` and `agent_session_id` when available using https://mlprep.iwase.dev/schema/attempt-record.json.
