We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
functionpangrams(s:string):string{/** * idea is simple * 1. create a set of unique character in [s] * 2. counting that set * if count == 26 return 'pangram' * if count != 26 return 'not pangram' * * note: 26 is number of letter in alphabet (in same case lower/upper) */let_s=newSet<string>()for(leti=0;i<s.length;i++){if(s[i]==' ')continue// i'm not counting spaces_s.add(s[i].toLowerCase())}return_s.size==26?'pangram':'notpangram'}
Cookie support is required to access HackerRank
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 →
My answer in Typescript, simple, not minimized