Query string nested parser
Parse a URL query string with PHP/Rails-style nested bracket keys into a nested dictionary. A key like 'a[b][c]=v' produces {'a': {'b': {'c': 'v'}}}. Plain keys 'x=1' map directly. Values are URL-decoded (treat '+' as space and decode %XX). Pairs are joined by '&'; ignore tokens without '='. An empty query string returns an empty dict. Later keys may extend or overwrite earlier nested structure. Assume keys are well-formed (balanced brackets).
Implement
parse_nested_query(qs: str) → dictExamples
in
["a[b]=c"]out{"a":{"b":"c"}}What a strong answer looks like
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.
0:00 of about 25 min
solution.py
InputExpectedGot
["a[b]=c"]{"a":{"b":"c"}}not run yetsample