The intersect?() is an inbuilt method in Ruby returns true if the set and the given set have at least one element in common.
Parameters: The function accepts a mandatory parameter set with whom it is checked for.
Return Value: It returns true if the set and the given set have at least one element in common or else it returns false.
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.