Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- val testSeq: Seq[String] = Seq("RootA_", "RootB_", "RootC_")
- def findRoot(ss: Seq[String], root: String): String = ss match {
- case h :: Nil => h.intersect(root)
- case h :: t => findRoot(t, h.intersect(t.head))
- }
Add Comment
Please, Sign In to add comment