Move scala codebase in a directory on its own

This commit is contained in:
Xavier Morel
2020-12-03 10:23:51 +01:00
parent a04451f2f7
commit 7dc5d839af
36 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
import scala.io.StdIn._
val ASCII_MIN_MAJ_INTERVAL = 32 // 'a' - 'A'
val res = readLine
.foldLeft(""){
case (acc, chr) => chr match {
case _ if acc.isEmpty => chr.toString
case _ if (acc.last - chr).abs == ASCII_MIN_MAJ_INTERVAL => acc.dropRight(1)
case _ => acc + chr
}
}
println(res.size)