5 ms·
As far as the integer intersection question goes, I wonder if the interviewer didn't think too hard before before saying that he never uses it. At least where I
by devrelm 13y ago
As far as the integer intersection question goes, I wonder if the interviewer didn't think too hard before before saying that he never uses it. At least where I work it comes up from time-to-time.
For instance, say we have a list of Users and a list of UserIds that we want to filter on (but for one reason or another don't want to do the filtering in the database.) The problem of getting the filtered list of Users based on their unique integer UserId has nearly the exact same solution as finding the intersection of the two integer lists, one being the requested UserIds filter, and the other being the list of UserIds from our list of Users.