Accumulate the elements of vector X into an array F based on the index list I (i.e. F[I[k]] += X[k] for every k, starting from an all-zero F sized to cover the largest index in I). Return F.
X
F
I
F[I[k]] += X[k]
k
solve(...)