Fetch Content Up to a Word Budget from a Paginated API

Implement a wrapper around a paginated external API that returns content up to a word budget.

The caller provides this API:

fetch_page(cursor: str | None) -> tuple[list[str], str | Non...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: