You can either use Don’s solution or:
Seq.fill(n)(Random.nextInt)
Note that you don’t need to create a new Random
object, you can use the default companion object Random, as stated above.
You can either use Don’s solution or:
Seq.fill(n)(Random.nextInt)
Note that you don’t need to create a new Random
object, you can use the default companion object Random, as stated above.