My Java Solution


  • 0
    R
    public boolean detectCapitalUse(String word) {
            if(word ==  word.toUpperCase()) return true;
            for(int i = 1; i < word.length(); i++){
                int value = (int) word.charAt(i);
                if(value < 97 || value > 122 ) return false;
            }
            return true;
        }

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.