I am trying to find the number of sub arrays which equals to a given sum K. For example, when I have an arr = [1, -1, 1, -1, 1], I created a new array such that: