-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The solution to 65 doesn't make sense #61
Comments
I think the question is ill-posed but the result is the expected one. The idea is that instead of directly accumulating values in I, there is an indirection. For example, at index 1 in the results, instead of 2 (because there are two So the question needs to be rephrased, if you have a suggestion... |
@rougier I see, thanks. "Accumulate" means sum up, not collect. And the task directly corresponds to
I think you can mention |
Even with this mention, I'm not sure it clarifies the question. I wrote the original question but I had some difficulties in finding what I meant 😞. Would you have some better formulation? |
The task is as follows: How to accumulate elements of a vector (X) to an array (F) based on an index list (I)? To me this means that
F
should contain some elements ofX
, in the order defined by the indices vector.The proposed solution looks like this:
Which results in:
[0. 7. 0. 6. 5. 0. 0. 0. 0. 3.]
.X
doesn't contain0
or7
. Why is this a solution?The text was updated successfully, but these errors were encountered: