#C14967. Sum of Integers from String Representations
Sum of Integers from String Representations
Sum of Integers from String Representations
You are given a list of strings, where each string represents a list of integers in Python list notation. Your task is to compute the sum of the integers for each string.
The sum of a list \( [a_1, a_2, \dots, a_n] \) is computed as:
$$S = \sum_{i=1}^{n} a_i$$
Output the sums as space-separated integers on a single line.
inputFormat
The first line contains an integer n, the number of strings. Each of the following n lines contains a string that is a representation of a list of integers (e.g., "[1, 2, 3]").
outputFormat
Output a single line with n space-separated integers. Each integer is the sum of the numbers from the corresponding input string.
## sample3
[1, 2, 3]
[4, 5, 6]
[7, 8, 9]
6 15 24
</p>