#Time Complexity: O(n), where `n` is the length of the array. #Space Complexity: O(n), for storing cumulative sums in a hash map. n = len(arr) # Length of the array. # Convert 0s to -1 to handle ...