You are viewing a single comment's thread. Return to all comments →
Scala resolution
def f(num: Int, arr: List[Int]): List[Int] = arr.flatMap(x => for (i <- 1 to num) yield x)
Seems like cookies are disabled on this browser, please enable them to open this website
List Replication
You are viewing a single comment's thread. Return to all comments →
Scala resolution
def f(num: Int, arr: List[Int]): List[Int] = arr.flatMap(x => for (i <- 1 to num) yield x)