Skip to content

Latest commit

 

History

History

081-sum-to-zero

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Sum to Zero

Challenge Description:

You are given an array of integers. Count the numbers of ways in which the sum of 4 elements in this array results in zero.

Input sample:

Your program should accept as its first argument a path to a filename. Each line in this file consist of comma separated positive and negative integers. E.g.

2,3,1,0,-4,-1
0,-1,3,-2

Output sample:

Print out the count of the different number of ways that 4 elements sum to zero. E.g.

2
1