Challenge 6: A Subarray with a Sum of 0
In this exercise, you will find a subarray whose sum turns out to be zero. Let's try it out!
Problem statement
You must implement the bool findSubZero(int[] arr, int size)
function, which will take in an array of positive and negative integers. It will tell you if there exists a subarray in which the sum of all elements is zero. The term “subarray” implies that the elements whose sum is ...
Access this course and 1400+ top-rated courses and projects.