Check if the Sentence Is Pangram
check一个string是不是包含所有的26个字母
1 2 3 4 5 6 7 8 9 10 11 12 13 |
class Solution { public boolean checkIfPangram(String sentence) { int[] count = new int[26]; for(char c : sentence.toCharArray()){ count[c - 'a']++; } for(int n : count){ if(n == 0) return false; } return true; } } |