I have two lists, list1 and list2, I want to get all elements that are present in list1 but not in list2. Currently, I am typecasting lists into set and subtracting them and then again typecasting result to list.
list(set(list1) - set(list2));
But this is not performance efficient. Can you please suggest me alternate ways to do the same thing?