Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
I think you misunderstand the problem. The problem is that there is no a guaranteed order of execution of all of the times that the lambda expression is executed.
This comment is hidden because it contains spoiler information about the solution
Not an issue - int is a value type, meaning p is passed by value and not by reference. So you can mutate it all you like inside the method and it will not affect the original parameter from the caller's perspective.
There is a better solution. My machine computes the answer for n=100 in less than 4 seconds. If you want to test it the answer is
"Range: 7412080755407363 Average: 4323892498073.29 Median: 1859362246.00"
This comment is hidden because it contains spoiler information about the solution
Since query methods are lazy, mutation inside a lambda passed to a query is a very bad idea.