Problem Description

You get a JSON object, a path like a.b[0].c, and a JSON value. Set that path in the object (create objects/arrays when needed). Print updated object as JSON.

Input Format

Line1: JSON object. Line2: path string. Line3: JSON value.

Output Format

One line JSON output.

Sample Test Case

Input:
{} a.b[0].c 5
Output:
{\"a\":{\"b\":[{\"c\":5}]}}

Constraints

Total nodes after creation up to 2e5.

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next