In Scala mutable collections, SortedSet exists() method is utilized to test whether a predicate holds for some of the elements of the SortedSet or not.
Method Definition: def exists(p: (A) => Boolean): Boolean
Return Type: It returns true if the stated predicate holds true for some elements of the SortedSet 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.