# Sum an arbitrarily nested integer list

> ML Prep screening item.

- Stable ID: `prog-rec-nested-total`
- Collection: screening
- Area: Programming
- Topic: Recursion
- Origin: original
- Difficulty: hard
- Expected time: 15 minutes
- Skills: base-case, recursive-implementation
- Item JSON: https://mlprep.iwase.dev/item/prog-rec-nested-total.json

## Problem

Implement `nested_total(value)` where `value` is either an integer or a
list containing more valid values. Lists may be empty and nesting depth is
arbitrary. Do not use loops, `sum`, or slicing.


## 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-rec-nested-total`, and record a real attempt with `recorded_by: "agent"` and `agent_session_id` when available using https://mlprep.iwase.dev/schema/attempt-record.json.
