Query string nested parser
Your task
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).
Examples
parse_nested_query(qs: str) -> dictExample 1
Input
parse_nested_query("a[b]=c")Output
{"a": {"b": "c"}}