• + 0 comments

    My JS solution with ASCII char code approach

    const pangrams = s => {
        const string = s.toLowerCase().replace(/ /g, "");
        const charCodeArr = [...new Set([...string].map((_, i) => string.charCodeAt(i)))].sort((a, b) => a - b);
        
        for (let i = 97; i <= 122; i++) {
            if (!charCodeArr.includes(i)) return "not pangram";
        }
        return "pangram";
    }