Please Login in order to post a comment
return "pangram" if set('abcdefghijklmnopqrstuvwxyz').issubset(s.lower()) else "not pangram"
public static String pangrams(String s) { // Write your code here var letters = s.chars() .filter(c -> Character.isAlphabetic(c)) .map(c -> Character.toLowerCase(c)) .mapToObj(c -> c) .collect(Collectors.toSet()); return letters.size() == 26 ? "pangram" : "not pangram";
Python
def pangrams(s): alphabet={} for i in s.lower(): if i.isalpha() and i in alphabet: alphabet[i]+=1 elif i.isalpha() and i not in alphabet: alphabet[i]=0 if len(alphabet)==26: return "pangram" else: return "not pangram"
//Swift
func pangrams(s: String) -> String { // Write your code here var set: Set = []
for char in s { set.insert(char.lowercased()) } set.remove(" ") if set.count == 26 { return "pangram" } else { return "not pangram" }
}
def pangrams(s): # Write your code here pre_str=s.strip() pre_str=pre_str.replace(' ','') pre_str=pre_str.lower() alpha=set(pre_str) if len(alpha)<26 : return 'not pangram' else: return "pangram"
Seems like cookies are disabled on this browser, please enable them to open this website
return "pangram" if set('abcdefghijklmnopqrstuvwxyz').issubset(s.lower()) else "not pangram"
Python
//Swift
func pangrams(s: String) -> String { // Write your code here var set: Set = []
}
def pangrams(s): # Write your code here pre_str=s.strip() pre_str=pre_str.replace(' ','') pre_str=pre_str.lower() alpha=set(pre_str) if len(alpha)<26 : return 'not pangram' else: return "pangram"