@@ -0,0 +1,850 @@
+/**%0A * Given a word, you need to judge whether the usage of capitals in it is right or not.%0A *%0A *We define the usage of capitals in a word to be right when one of the following cases holds:%0A *%0A *All letters in this word are capitals, like %22USA%22.%0A *All letters in this word are not capitals, like %22leetcode%22.%0A *Only the first letter in this word is capital if it has more than one letter, like %22Google%22.%0A *Otherwise, we define that this word doesn't use capitals in a right way.%0A *Example 1:%0A *Input: %22USA%22%0A *Output: True%0A *Example 2:%0A *Input: %22FlaG%22%0A *Output: False%0A *Note: The input will be a non-empty word consisting of uppercase and lowercase latin letters.%0A *%0A *%0A */%0Aclass Solution %7B%0A    public boolean detectCapitalUse(String word) %7B%0A        return word.matches(%22%5E%5BA-Z%5D%5Ba-z%5D+$%22) %7C%7C word.matches(%22%5E%5BA-Z%5D+$%22) %7C%7C word.matches(%22%5E%5Ba-z%5D+$%22);%0A    %7D%0A%7D%0A

Create DetectCapital.java