public static void getResult(int[] num){
int len = num.length;
int[] result = new int[len];
for (int i = 0; i < len ; i++){
result[i] += (i > 0) ? result[i-1]+ num[i] : num[i];
}
int max = 0;
int start = 0;
HashMap<Integer,Integer> map = new HashMap<Integer, Integer>();
for (int i = 0; i < len; i++){
if (map.get(result[i]) == null){
map.put(result[i], i);
}else{
int gap = map.get(result[i]);
if (max < i-gap){
max = i - gap;
start = gap;
}
}
}
for (int i = start; i < max; i++){
System.out.print(num[i]+" ");
}
}