Thread Message #1429
2 messages · –K class Implementation { public String spotCapitals(String word) { boolean allCapital = true, allSmall = true, camel = true; for (int i = 0; i < word.length(); i++) { char ch = word.charAt(i); if (i == 0 && Character.isLowerCase(ch)) camel = false; if (Character.isUpperCase(ch)) { allSmall = false; } else { allCapital = false; } } return allCapital||allSmall||camel? "CORRECT": "INCORRECT"; } }