Please Login in order to post a comment
my JavaScript solution
function pangrams(s) { const isPangram = s => new Set(s.toLowerCase().match(/[a-z]/g)).size === 26 ? "pangram" : "not pangram"; return isPangram(s); }
Python 3 solutions:
import string import typing ALPHABET: set[str] = {*string.ascii_uppercase} def pangrams(s: str) -> typing.Literal["pangram", "not pangram"]: return "pangram" if {*s.upper()} >= ALPHABET else "not pangram" def pangrams(s: str) -> typing.Literal["pangram", "not pangram"]: return "not pangram"[4 * (len({*s.upper().replace(" ", "")}) == 26) :] pangrams=lambda s:(len({*s.upper()}-{" "})<26)*"not "+"pangram" # 63
def pangrams(s): # Write your code here if not (set(string.ascii_lowercase) - set(s.lower())): return "pangram" return "not pangram"
My TypeScript solution:
function pangrams(s: string): string { const alphabet = "abcdefghijklmnopqrstuvwxyz"; const ALPH_LENGTH = 26; for (let i = 0; i < ALPH_LENGTH; i++) { if (!s.toLocaleLowerCase().includes(alphabet[i])) return "not pangram"; } return "pangram"; }
python 3
def pangrams(s): return "pangram" if 26 == len(set([x for x in s.lower() if x.isalpha()])) else "not pangram"
Seems like cookies are disabled on this browser, please enable them to open this website
my JavaScript solution
Python 3 solutions:
My TypeScript solution:
python 3