Why isn’t the case when i th element of the array is k included?
Why isn't the case where arr[i]==k included?
look up to the 11th line of code, it is included.
The 11th line of the code is where we check if pre==k which is the sum upto that point not the i th element. What I am asking is why are we not checking for arr[i]==k???
That case is automatically handled by doing binary search on prefix sum array