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.
This comment is hidden because it contains spoiler information about the solution
It seems that the issue here is that "last" is a reference, but the result of ".collect<Vec>()" is a temporary, so in the next invocation of the closure last would be referencing a Vec from a previous closure's stack-frame which would probably blow-up, and Rust is protecting you from the creating the corruption. Happy coding!
I tried to hard-code this problem to check my understanding, and my solution produced 5001 for the first test case. When I checked the math 4 * 5001 ^ 2 + 1 is indeed divisible by 13 and 5, so this seems correct. However, the first test case suggests that the cloest value to m=5000 is 5074. Am I missreading something?