You are viewing a single comment's thread. Return to all comments →
There's no need to have two char arrays big and small. You can just have one and keep a counter, if it reaches 26, just break.
if(s[c] - 'A' < 26 && s[c] - 'A' >= 0 && map[s[c] - 'A'] ==0) { map[s[c] - 'A']++; count++; }else if(c - 'a' < 26 && s[c] - 'a' >= 0 && map[s[c] - 'a'] ==0) { map[s[c] - 'a']++; count++; } if(count == 26) { System.out.println("pangram"); return; }
Pangrams
You are viewing a single comment's thread. Return to all comments →
There's no need to have two char arrays big and small. You can just have one and keep a counter, if it reaches 26, just break.