#K62622. JSON Parser Validator
JSON Parser Validator
JSON Parser Validator
You are required to implement a program that parses a JSON-formatted string into the corresponding data structure. The program should support the following JSON types: null, booleans, numbers, strings, arrays, and objects. In case the input JSON string is malformed, the program must output Error
.
The output must follow the Python-style representation. For example, when the input is null
, the output should be None
; when the input is true
, the output should be True
; when the input is "hello"
, the output should be 'hello'
.
inputFormat
The input consists of a single line containing a JSON-formatted string. The string may represent any valid JSON value (or an invalid one in which case your program should output Error
).
outputFormat
If the JSON string is valid, output its Python-style representation. Otherwise, output Error
.
null
None