4 ms·You store the selected items in a hashtable or similar data structure with O(1) behavior of "x in y".by keypusher 11y agoYou store the selected items in a hashtable or similar data structure with O(1) behavior of "x in y".