Using a set
is not the only way to keep track of the items that have been encountered in the original list
. It was used in the example because it is an efficient way to do it.
The best thing to do at this time is for you to post the code that you have thus far, so we can offer effective help. Please read the following before you post the code:
After reading the material at the above links, you will know how to post code in the proper format.