scala list comprehension
could be improved with memoization\nscala []\nobject Solution {\n  def ambiguousCoordinates(s: String): List[String] = {\n    val d0 = s.tail.init\n    for{\n  
could be improved with memoization\n```scala []\nobject Solution {\n  def ambiguousCoordinates(s: String): List[String] = {\n    val d0 = s.tail.init\n    for{\n      i0 <- (0 to d0.length).toList\n      (t1,d1) = d0.splitAt(i0)\n      if t1.length==1 || (t1.length>1 && t1.head != \'0\')\n\n      i1 <- (0 to d1.length)\n      (t2,d2) = d1.splitAt(i1)\n      if !t2.lastOption.contains(\'0\')\n\n      i2 <- (0 to d2.length)\n      (t3,t4) = d2.splitAt(i2)\n      if t3.length==1 || (t3.length > 1 && t3.head != \'0\')\n      if !t4.lastOption.contains(\'0\')\n    } yield {\n      List(List(t1,t2), List(t3,t4))\n        .map(_.filter(_.nonEmpty).mkString("."))\n        .mkString("(",", ",")")\n    }\n  }\n}\n```
['Linked List', 'String', 'Enumeration', 'Scala']