Advertisement
Guest User

Untitled

a guest
Apr 24th, 2015
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.16 KB | None | 0 0
  1.   def decode[T](list: List[(Int, T)]): List[Any] = list match {
  2.     case h :: tail => Array.fill(h._1) { h._2 } :: decode(tail)
  3.     case Nil       => Nil
  4.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement