Question
Redact sensitive values from a nested structure before logging. Given a JSON-like structure (dicts, lists, and scalars) and a list of sensitive key names (case-insensitive), return a deep copy where any dict value whose key matches a sensitive name (compared lowercased) is replaced with the string '[REDACTED]', recursing into nested dicts and lists. Non-matching scalars are left as-is. Do not mutate the input.
redact(data: any, sensitive: list[str]) → any[{"user":"alice","password":"p@ss"},["password"]]out{"user":"alice","password":"[REDACTED]"}State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.
Vibe coding: describe the solution in plain language (or narrate it) and the coach grades your approach. Generating runnable code from your description is coming next.