Skip to content
C

Zero Sum Subarray

Mediumjavapythonccppjavascript

Determine whether the array contains a non-empty contiguous subarray whose elements sum to zero.

Input Format

The first line contains an integer N. The second line contains N space-separated integers.

Output Format

Print 1 if a zero-sum subarray exists, otherwise print 0.

Input (stdin)

Output

Run your code to see output here...