Given a binary array nums and an integer goal , return the number of non-empty subarrays with a sum goal .
A subarray is a contiguous part of the array.
1 <= nums.length <= 3 * 10 ^4
nums[i] is either 0 or 1 .
0 <= goal <= nums.length