can this be expressed as `result[indices] += 1`?