Practice problems using sorting
Today we solved two practice problems:
we showed two different methods for finding all divisors of a positive integer.
we wrote a function to test whether two input vectors have the same elements
(not necessarily in the same order).
Extra stuff to try for fun (not required)
The source code for factoring.cpp above demonstrates that the divisorsFast function actually has a bug:
it doesn't give the right output when the input is 9.
Figure out what's going wrong and then fix it!
This should only require a few lines of code changes at most.
The comment at the top of sameElements.cpp above mentions two different ways
of interpreting the problem requirements.
The posted code solves the problem assuming the first interpretation.
Try writing a new version of the sameElements function that works using the second interpretation instead.
Make sure you add enough tests to main() to make sure your new function is doing the right thing!