harbor run -t openthoughts/tasktrove-exp-rpt-curriculum-hard-curriculum-hard-0489harbor download openthoughts/tasktrove-exp-rpt-curriculum-hard-curriculum-hard-0489You must implement a memory-efficient, streaming solution that generates a random string of a given length from ASCII letters (uppercase and lowercase) without ever building the entire string in memory, and then counts the occurrences of each character that appears in that string. The function must be robust to very large inputs, handle edge cases, and be structured in a way that can be extended to multi-file, concurrent architectures while preserving a simple public API.
Public API
Requirements and design notes
import collections
import random
import string
def task_func(length=100):
Validation and testing hints (not part of the code)
Placement and exports
Your solution should be self-contained, only relying on the standard library (collections, random, string) and basic Python features.