I have a hypothetical map - HashMap<String,List<String>> mapteachertostudents
.
There is a separate set - Set<String> giftedstudents
.
The ask is simply print out the common students using java 1.7
mapteachertostudents { 'A':'a,b,c';'B':'b,e';'C':'b,c,f'}
giftedstudents ['b','c','e']
expected output ['b']
Is there a more efficient routine than iterating each teacher and maintaining state,considering that this comparison has to be run over 10000+ maps each.