package datastructure.hashtable;
import java.util.HashMap;
/**
* The type Sub array zero.
*/
public class SubArrayZero {
/**
* Find sub zero boolean.
*
* @param arr the arr
* @return the boolean
*/
public static boolean findSubZero(int[] arr) {
//Use HashMap to store Sum as key and index i as value till sum has been calculated.
//Traverse the array and return true if either
//arr[i] == 0 or sum == 0 or HashMap already contains the sum
//If you completely traverse the array and havent found any of the above three
//conditions then simply return false.
HashMap