← 返回 salesforce 的题目列表Flatten Nested HashMap JSON
类型:online_judge
Given a nested JSON format string, output a flattened string. Assume the JSON object is represented using a nested HashMap where each key maps to either another nested HashMap or a basic type. Design a recursive function to flatten this structure. Input:
{"a": 1, "b": {"c": 2, "d": {"e": 3}}}
Output:
{"a": 1, "b.c": 2, "b.d.e": 3}
```. Please provide multiple test cases to verify the functionality and details on the data scale.
Example
Input
{"a": 1, "b": {"c": 2, "d": {"e": 3}}}