Write a Python script to parse a nested JSON file.
Implement parse_nested_json(json_text) to parse a JSON string and return a dictionary containing every leaf value. Use dot-separated keys for nested objects and bracket notation for array indexes, such as user.address.city and items[0].sku. Empty objects and arrays are treated as leaf values. Preserve JSON value types.
Signature: def parse_nested_json(json_text):
Return the flattened dictionary.
json_text is a valid JSON string.def parse_nested_json(json_text):