Hello, i have some trouble.
Why it’s work without the function?
val lazyList: LazyList[Int] = 999 #:: lazyList.map(_.toString.split("").map(_.toInt).product)
And in function definition:
def digitalRoot(n: Int): Int = {
val lazyList: LazyList[Int] = n #:: lazyList.map(_.toString.split("").foldLeft(0)(_ + _.toInt))
...
}
throw forward reference to value stream defined on line 2 extends over definition of value stream
?