Any particular reason why this isn't good enough?
Probably because loops are still too hard and recursion is taught two classes beyond this one? Remember, just because you understand recursion and vectors and all that high level stuff does not mean someone in their first class has ever even heard of them, let alone been taught it.
8-]
so if the first element of the array does not equal the second element then the contents of what Walker is pointing to gets assigned the first array element. Walker is then plus plused so that the next time array[i] != array[j] we don't replace the the same thing in Walker over and over again. usize is simply used for output reasons, we need to know how big the new dynamic array is so that we can output it correctly.
Yeah, that's what it does all right. I still have absolutely no idea what Walker
is for but getting loaded with a bunch of letters.
Try outputting Walker
after each loop and see if it contains what you expect. In fact, after the first loop do you even know what should be in Walker
???