Created
November 3, 2015 15:18
-
-
Save fancellu/95552ea77e860e0ffc93 to your computer and use it in GitHub Desktop.
Pangrams for HackerRank
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def isPangram(strings: Array[String]): String = { | |
val values=for{ | |
string<-strings | |
set=string.toLowerCase().toSet | |
isPangram=('a' to 'z').forall(set.contains) | |
} yield if (isPangram) 1 else 0 | |
values.mkString | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment