BAEL-2536-addressed review comments

This commit is contained in:
Varun Jain
2019-01-05 10:38:13 +05:30
parent 693da95f44
commit 082724abec
2 changed files with 17 additions and 18 deletions

View File

@@ -15,10 +15,10 @@ public class Pangram {
Boolean[] alphabetMarker = new Boolean[ALPHABET_COUNT];
Arrays.fill(alphabetMarker, false);
int alphabetIndex = 0;
str = str.toUpperCase();
String strUpper = str.toUpperCase();
for (int i = 0; i < str.length(); i++) {
if ('A' <= str.charAt(i) && str.charAt(i) <= 'Z') {
alphabetIndex = str.charAt(i) - 'A';
if ('A' <= strUpper.charAt(i) && strUpper.charAt(i) <= 'Z') {
alphabetIndex = strUpper.charAt(i) - 'A';
alphabetMarker[alphabetIndex] = true;
}
}