Scala: water pouring problem solution