public static boolean subArraySum(int[] arr, int sum){
        int currSum = 0;
        for(int start = 0, end = 0; end < arr.length; end++){
            currSum += arr[end];
            if(currSum == sum){
                System.out.println("Sum found between indexes " + start + " and " + end);
                return true;
            }else if(currSum < sum){
                continue;
            }else{
                while(currSum > sum && start < end - 1){
                    currSum -= arr[start++];
                }
                if(currSum == sum){
                    System.out.println("Sum found between indexes " + start + " and " + end);
                    return true;
                }
            }
        }
        System.out.println("No subarray found");
        return false;
    }