Given a string A representating json object. Return an array of string denoting json object with proper indentaion.
Rules for proper indentaion:
Note:
[]
and {}
are only acceptable braces in this case.
Assume for this problem that space characters can be done away with.
Input Format
The only argument given is the integer array A.
Output Format
Return a list of strings, where each entry corresponds to a single line. The strings should not have "\n" character in them.
For Example
Input 1:
A = "{A:"B",C:{D:"E",F:{G:"H",I:"J"}}}"
Output 1:
{
A:"B",
C:
{
D:"E",
F:
{
G:"H",
I:"J"
}
}
}
Input 2:
A = ["foo", {"bar":["baz",null,1.0,2]}]
Output 2:
[
"foo",
{
"bar":
[
"baz",
null,
1.0,
2
]
}
]
NOTE: You only need to implement the given function. Do not read input, instead use the arguments to the function. Do not print the output, instead return values as specified. Still have a doubt? Checkout Sample Codes for more details.