Skip to content

Instantly share code, notes, and snippets.

package com.knoldus.kip.models
class Stack(stackWithList: List[Int]) {
def pop: Stack = {
if(stackWithList.isEmpty) {
throw new RuntimeException
}
new Stack(stackWithList.tail)
}