Check if a string is Pangrammatic Lipogram | collection of letters ; Function to check for a Pangrammatic Lipogram ; Convert string to lowercase ; Variable to keep count of all the letters not found in the string ; Traverses the string for every letter of the alphabet ; If character not found in string then increment count ; Driver code
let alphabets = " " ; function panLipogramChecker ( s ) { for ( let i = 0 ; i < s . length ; i ++ ) { s [ i ] = s [ i ] . toLowerCase ; } let counter = 0 ; for ( let i = 0 ; i < 26 ; i ++ ) { let pos = s . search ( alphabets [ i ] ) ; if ( pos < 0 pos > s . length ) counter += 1 ; } if ( counter == 0 ) document . write ( " " ) ; else if ( counter >= 2 ) document . write ( " " + " " ) ; else document . write ( " " ) ; } let str = " " + " " ; panLipogramChecker ( str ) ; document . write ( " " ) ; str = " " + " " ; panLipogramChecker ( str ) ; document . write ( " " ) ; str = " " + " " ; panLipogramChecker ( str ) ;