#C13997. Construct a Specific Data Structure
Construct a Specific Data Structure
Construct a Specific Data Structure
Your task is to construct and output a nested data structure with specific values. In particular, you need to output a dictionary (or map) with exactly four keys: "A", "B", "C", and "D". The value for each key is defined as follows:
- Key ( A ): a list containing an integer 8, a string "Mars", and another dictionary with keys ( subA ) and ( subB ) whose values are ( true ) and ( 3.14 ) respectively.
- Key ( B ): a tuple of three identical integers ( 14 ) (output as an array).
- Key ( C ): a dictionary with two keys: ( innerA ) with value "ABCD" and ( innerB ) with value being a list containing "hello", ( 42 ), and ( true ).
- Key ( D ): a set containing the integers 2, 3, and 5 (output as a sorted array [2, 3, 5]).
The output must be a JSON string (with keys in double quotes) representing this data structure. Use ( \LaTeX ) format for any mathematical formulas as shown above.
inputFormat
There is no meaningful input for this problem. Your program should read from standard input (stdin) but ignore any input and always output the specified data structure.
outputFormat
Output the data structure in JSON format. The JSON should represent a dictionary with keys "A", "B", "C", and "D". Note that:
( A = [8, \text{Mars}, {\text{subA}: \text{true}, \text{subB}: 3.14}] ) ( B = (14, 14, 14) ) (output as an array: [14, 14, 14]) ( C = {\text{innerA}: \text{ABCD}, \text{innerB}: [\text{hello}, 42, \text{true}]} ) ( D = {2, 3, 5} ) (output as a sorted array: [2, 3, 5])
Make sure your output exactly matches the expected JSON string.## sample
{"A": [8, "Mars", {"subA": true, "subB": 3.14}], "B": [14, 14, 14], "C": {"innerA": "ABCD", "innerB": ["hello", 42, true]}, "D": [2, 3, 5]}