In addition to the work in #468, I propose to simplify the code. It seemed to be complicated enough that we didn't fix an out-of-bounds access in the solution, so here I propose to take the randomness out of the exercise, and go for a simple reverse.
During the C++ course at JLab, a mentor suggested to add a check for correctness, which is trivial when the collection just has to be reversed.
I did a similar thing for the valgrind part, but I added an off-by-one mistake in the reverse function, and a memory leak in main. That should hopefully be enough for people to find.
Note: Either close #468 and merge the current one, or merge #468 and this gets rebased.
In addition to the work in #468, I propose to simplify the code. It seemed to be complicated enough that we didn't fix an out-of-bounds access in the solution, so here I propose to take the randomness out of the exercise, and go for a simple reverse.
During the C++ course at JLab, a mentor suggested to add a check for correctness, which is trivial when the collection just has to be reversed.
I did a similar thing for the valgrind part, but I added an off-by-one mistake in the reverse function, and a memory leak in main. That should hopefully be enough for people to find.
Note: Either close #468 and merge the current one, or merge #468 and this gets rebased.