#C9008. Symmetric Array Checker
Symmetric Array Checker
Symmetric Array Checker
You are given an array of integers. An array is considered symmetric if for every integer x in the array, the number of occurrences of x is equal to the number of occurrences of -x. Formally, the array A is symmetric if and only if
Note that an empty array is considered symmetric, and an array with a single non-zero element is not symmetric because the pair for that element does not exist.
Your task is to check whether the given array is symmetric or not.
inputFormat
The first line contains a single integer n (which can be zero), representing the number of elements in the array. If n > 0, the second line contains n space-separated integers.
Examples:
- For an input
4
in the first line and1 -1 2 -2
in the second line, the array is [1, -1, 2, -2]. - For an input
0
, there is no second line and the array is empty.
outputFormat
Output a single line: print Symmetric
if the array is symmetric; otherwise, print Not Symmetric
.
Note: The output is case-sensitive.
## sample4
1 -1 2 -2
Symmetric
</p>