File tree 1 file changed +0
-21
lines changed
src/main/java/com/fishercoder/solutions
1 file changed +0
-21
lines changed Original file line number Diff line number Diff line change 1
1
package com .fishercoder .solutions ;
2
2
3
- /**
4
- * 520. Detect Capital
5
- *
6
- * Given a word, you need to judge whether the usage of capitals in it is right or not.
7
- * We define the usage of capitals in a word to be right when one of the following cases holds:
8
-
9
- All letters in this word are capitals, like "USA".
10
- All letters in this word are not capitals, like "leetcode".
11
- Only the first letter in this word is capital if it has more than one letter, like "Google".
12
- Otherwise, we define that this word doesn't use capitals in a right way.
13
-
14
- Example 1:
15
- Input: "USA"
16
- Output: True
17
-
18
- Example 2:
19
- Input: "FlaG"
20
- Output: False
21
-
22
- Note: The input will be a non-empty word consisting of uppercase and lowercase latin letters.
23
- */
24
3
public class _520 {
25
4
public static class Solution1 {
26
5
public boolean detectCapitalUse (String word ) {
You can’t perform that action at this time.
0 commit comments