I have a List<User> users, where classUser has one property username. I also have anotherList<User> activeUsers. Let users = activeUsers + inactiveUsers. Now I want to extract inactiveUsers from users based on username property. I solved this problem using two for-loops. I think this is not efficient way. so if anyone know how it can be done efficiently please let me know.
e.g. I have activeUsers[1,3] and users[1,2,3,4] and want to build inactiveUsers[2,4].
activeUsersare active.