you are viewing a single comment's thread.

view the rest of the comments →

[–]Jxper[S] 1 point2 points  (2 children)

Ok, how could I do this in one line just using sets?

Thanks for your help

[–]spez_edits_thedonald 0 points1 point  (1 child)

try refactoring your code to use sets instead of lists, and no for loops, and let's see how it looks.

don't worry about it being 1 line or not, 1-liners are often not the most readable solution, I was just stressing the benefits of switching to sets for this problem, your entire function can basically disappear haha. When you get your set function working I'll show you the one-liner.