Equal to Zero in java

You will be given an array and you need to find those three elements whose sum are equal to 0.If found print True to the output else print False.Note: The length of the array should not be less than 3.




Input
6
1 1 1 1 1 1
output:

False

Input:
6
79 60 -44 -16 22 33

Output:
True  since(60+(-44)+(-16)=0)

Comments

Popular posts from this blog

Reasoning-Number Series

Reasoning-Letter Series

Profit and Loss