#K53267. Zero Sum Subarray
Zero Sum Subarray
Zero Sum Subarray
You are given an array of integers. Your task is to determine whether there exists a contiguous subarray whose sum is zero. In other words, find if there exist indices i and j such that $$\sum_{k=i}^{j} a_k = 0$$. If such a subarray exists, output True; otherwise, output False.
For instance, in the array [1, 2, -3, 4, 5], the subarray [1, 2, -3] sums to zero.
inputFormat
The input begins with an integer n (0 ≤ n ≤ 105), representing the number of elements in the array. If n is greater than 0, the next line contains n space-separated integers, each between -109 and 109.
outputFormat
Output a single line with True if there exists a contiguous subarray whose sum is zero; otherwise, output False.
## sample5
1 2 -3 4 5
True