Scala Stack dropRight() method with example
In Scala Stack class, the dropRight() method is utilized to drop the last ânâ elements of the stack. Method Definition: def dropRight(n: Int): Stack[A] Return Type: It returns a new stack that consists of all the elements except the last ânâ elements. Example #1: // Scala program of dropRight() // m