#C14950. Sum of Dictionary Values

    ID: 44656 Type: Default 1000ms 256MiB

Sum of Dictionary Values

Sum of Dictionary Values

Given a JSON object where each key is associated with a list of integers, compute a new JSON object with the same keys but where each value is the sum of the integers in the corresponding list. Formally, if the input JSON object is \(\{ k: v \}\) where each \(v\) is an array of integers, then the output should be \(\{ k: \sum v \}\). For example, if the input is {"a": [1,2,3],"b": [4,5,6],"c": [7,8,9]}, then the output should be {"a": 6, "b": 15, "c": 24}.

Note: Read input from standard input (stdin) and write the answer to standard output (stdout).

inputFormat

The input is a single line containing a JSON representation of a dictionary. Each key is a string and each value is an array of integers.

Example: {"a": [1,2,3], "b": [4,5,6], "c": [7,8,9]}

outputFormat

The output should be a single line containing a JSON representation of a dictionary where each key's list of integers is replaced by the sum of that list.

Example: {"a": 6, "b": 15, "c": 24}

## sample
{"a": [1, 2, 3], "b": [4, 5, 6], "c": [7, 8, 9]}
{"a":6,"b":15,"c":24}