Find indices i,j such that Sum of elements from i to j in both arrays is equal and j-i -- Amazon