We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent df54373 commit 761469aCopy full SHA for 761469a
leetcode/0520.Detect-Capital/520.Detect Capital.go
@@ -0,0 +1,13 @@
1
+package leetcode
2
+
3
+import "strings"
4
5
+func detectCapitalUse(word string) bool {
6
+ wLower := strings.ToLower(word)
7
+ wUpper := strings.ToUpper(word)
8
+ wCaptial := strings.ToUpper(string(word[0])) + strings.ToLower(string(word[1:]))
9
+ if wCaptial == word || wLower == word || wUpper == word {
10
+ return true
11
+ }
12
+ return false
13
+}
0 commit comments