Question
Parse a URL query string into a dict. Strip a leading `?` if present. Split on `&` into pairs; each pair is `key=value` (split on the first `=` only) or a bare `key` with no `=` (value is the empty string). Percent-decode both keys and values (e.g. `%20` -> space). If the same key appears more than once, its value becomes a list of all occurrences in order; a single occurrence stays a plain string. Empty pairs (from `&&`) are skipped. An empty input yields an empty dict.
parse_query(qs: str) → dict["a=1&b=2"]out{"a":"1","b":"2"}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.