6 lines scala recursion
\nobject Solution {\n  def decodeCiphertext(encodedText: String, rows: Int): String =\n    def f(i: Int, aMap:Map[Int,Seq[Char]] ,acc:Seq[Char]):Seq[Char] =\n  
```\nobject Solution {\n  def decodeCiphertext(encodedText: String, rows: Int): String =\n    def f(i: Int, aMap:Map[Int,Seq[Char]] ,acc:Seq[Char]):Seq[Char] =\n      if(aMap(i).isEmpty) acc else f((i+1)%rows, aMap + (i -> aMap(i).tail),aMap(i).head +: acc) \n    lazy val x0 = encodedText.toList\n      .grouped((encodedText.size + rows-1) / rows).toList.zipWithIndex\n      .map{case (l,i) => i -> l.drop(i)}.toMap\n    if(encodedText == "") "" else f(0, x0, Nil).dropWhile(_ == \' \').reverse.mkString\n}\n```
['Hash Table', 'Simulation', 'Scala']