You are viewing a single comment's thread. Return to all comments →
Scala
def pangrams(s: String): String = { val cleansedString = s.toLowerCase().trim().distinct val cleansedAsciiArray = cleansedString.map(_.toInt).toArray val asciiArray = ('a'.toInt to 'z'.toInt).toArray val isPangram = asciiArray.intersect(cleansedAsciiArray).length == 26 if(isPangram) "pangram" else "not pangram" }
Seems like cookies are disabled on this browser, please enable them to open this website
Pangrams
You are viewing a single comment's thread. Return to all comments →
Scala