#K82292. Zero Sum Pair Finder
Zero Sum Pair Finder
Zero Sum Pair Finder
Given a list of integers, your task is to determine whether there exists at least one pair of distinct elements whose sum is zero. In other words, determine if there exist indices i and j (with i < j) such that:
\(a_i + a_j = 0\)
This problem may involve edge cases, such as multiple occurrences of the same integer (including zero). For example, if the list contains two zeroes, then they form a valid pair.
Input will be read from standard input and output should be written to standard output.
inputFormat
The first line contains a single integer n, representing the number of elements in the list.
The second line contains n space-separated integers denoting the elements of the list.
outputFormat
Print True
if there exists at least one pair of numbers whose sum is zero. Otherwise, print False
.
5
1 2 -3 4 6
False