Advertisement
MiroJoseph

Meeting

Apr 5th, 2020
262
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.56 KB | None | 0 0
  1. import scala.collection.mutable.ListBuffer
  2. object Meeting {
  3.  
  4. def meeting(s: String): String = {
  5.   var splited = s.split(';').toList
  6.   var l:ListBuffer[String]=new ListBuffer[String]
  7.  
  8.   def splitting(NS: List[String]): List[String] = {
  9.     if (NS.nonEmpty) {
  10.       l.append(("("+NS.head.split(':')(1)+", "+NS.head.split(':')(0)+")").toUpperCase())
  11.       splitting(NS.tail)
  12.       }
  13.     else l.sorted.toList
  14.   }
  15.   def print(d:List[String], str:String):String={
  16.     if (d.nonEmpty)  print(d.tail, str+d.head)
  17.     else str
  18.   }
  19.   print(splitting(splited), "")
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement