—
Choose a built-in container by operation
Tutor me on https://mlprep.iwase.dev/item/prog-ds-container-plan/. This is a screening item. If window.mlPrepAgent is available, read attempts for item prog-ds-container-plan before tutoring. Inspect my attempt, keep the item ID, and do not reveal the full answer first. After a real attempt, append its record with recorded_by agent, include agent_session_id when available, and read it back.Problem
Choose the most direct Python container or standard abstraction for each case, in order: a mutable ordered batch; a fixed coordinate usable as a key; counts by word; unique visited IDs; undo in reverse order; jobs in arrival order; and repeatedly removing the smallest deadline. Give one operation-based reason for every choice.
Reveal answer or reference solution
Use: list for a mutable ordered batch; tuple for a fixed hashable
coordinate; dict as a hash map from word to count; set for unique
visited IDs and average membership; list used as stack for LIFO
undo via append/pop; collections.deque for queue operations at both
ends; and a heapq min-heap for repeated minimum removal in .
def container_plan() -> tuple[str, ...]:
return (
"list",
"tuple",
"dict",
"set",
"list used as stack",
"collections.deque",
"heapq min-heap",
)Public tests
container_plan()→('list', 'tuple', 'dict', 'set', 'list used as stack', 'collections.deque', 'heapq min-heap')
Previous attempts
Loading attempts saved in this browser…