The dropRight() is utilized to return all elements except last ‘n’ elements.
Method Definition: def dropRight(n: Int): Set[A]
Return Type: It returns a set containing all elements except last ‘n’ elements.
5 1 2 3
5 1 2
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.