Guest User

Untitled

a guest
Nov 21st, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. val testSeq: Seq[String] = Seq("RootA_", "RootB_", "RootC_")
  2.  
  3. def findRoot(ss: Seq[String], root: String): String = ss match {
  4. case h :: Nil => h.intersect(root)
  5. case h :: t => findRoot(t, h.intersect(t.head))
  6. }
Add Comment
Please, Sign In to add comment