I suggest you try documenting it yourself.
Some advice on how/where to start:
- Come up with an alogirthm to be used: take a piece of paper and try to solve the problem yourself. Go over each pair and make a note on how you decide in which group to put that pair;
- Post your algorithm here (in English);
- Try to turn your algorithm into code;
- Test the code;
- Post the code;
- Look back at the code I posted and see if you can understand what I wrote and why I wrote it. If question ask.;
I suggest this for the following reasons:
- It should be more rewarding;
- You will learn more;
- You will remember what you learned a lot longer;
The obvious downside is that it will take your more time to figure it out. If I document it/explain it then you know how to solve this particular problem but you might not be able to solve another, similar, problem since you might not see the alogirthm and/or forgot on how this problem was solved.
|