Unit 7 Lesson 3 - Netflix App - Repeated Recommendation

I was checking the Example Solution for the Netflix App and I noticed that the list of recommendations given by the app can contain the same movie/or TV show more than once.
I believe this happens because the searchTypeList function uses randomNumber to select 5 items (we run the loop 5 times) from the filteredTitles list, and it is possible to get the same number multiple times.
I thought this can be easily fixed by adding one line of code inside the second loop, right on the bottom. This is: removeItem(filteredTitles, index);
With this change, after each item is selected from the list and added to the variable output, it is removed from the list. Thus, there is no way we can get it again.
The next time we click the pickBtn, we call the searchTypeList function and the list gets populated again.
I have run the app several times and I think this works.

Great simple addition! I’m going to use this as a check for understanding/extension for my students to review list manipulation.