The find() method is utilized to find the first element of the SortedMap that satisfies the given predicate.
Method Definition: def find(p: ((A, B)) => Boolean): Option[(A, B)]
Return Type: It returns the first element of the SortedMap which satisfies the given predicate.
So, here the second pair which is the first pair that satisfies the given predicate so, the second pair is returned.
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.