3 ms·
If it's already a set in the language, use intersect. If the numbers are in a array or sth. similiar, make a set and use intersect. https://en.wikipedia.org/wik
by TN1ck 10y ago
If it's already a set in the language, use intersect. If the numbers are in a array or sth. similiar, make a set and use intersect.
https://en.wikipedia.org/wiki/Intersection_(set_theory) https://en.wikipedia.org/wiki/Intersection_(set_theory)
- WorldMaker 10y agoWe here at Company X believe that math is not useful unless it is bespoke, hand-made, artisanal. Please pretend that set theory does not yet exist in this universe, and describe to us the smell of the algorithm you might write to solve this problem.
- dTal 10y agoYou just described the "what", not the "how". The implied context is algorithmic. It'd be like answering a question about sorting lists with "use sort()" - true enough in practical terms, but smart-arsey and deliberately avoiding the meat of the question.