Array for keeping track of both uppercase and lowercase english alphabets
let uppercase = new Array ( 26 ) ; uppercase . fill ( false ) ; let lowercase = new Array ( 26 ) ; lowercase . fill ( false ) ; let arr = str . split ( ' ' ) ; for ( let c = 0 ; c < arr . length ; c ++ ) { if ( arr == arr . toLowerCase ( ) ) lowercase [ arr . charCodeAt ( ) - 97 ] = true ; if ( arr == arr . toUpperCase ( ) ) uppercase [ arr . charCodeAt ( ) - 65 ] = true ; }