hash and tree return different indices, so it is not sufficient to compare their results, we have to verify that the sum of the range is the target