Update solution 0520

This commit is contained in:
halfrost
2021-11-12 21:21:21 +08:00
committed by halfrost
parent 8f64507c9c
commit f0792d1179
12 changed files with 105 additions and 26 deletions

View File

@ -1,4 +1,4 @@
# [520. Detect Capital](https://leetcode-cn.com/problems/detect-capital/)
# [520. Detect Capital](https://leetcode.com/problems/detect-capital/)
## 题目
@ -44,11 +44,13 @@ Output: false
## 解题思路
- 把word分别转换为全部小写wLower全部大写wUpper首字母大写的字符串wCaptial
- 判断word是否等于wLower,wUpper,wCaptial中的一个如果是返回true否则返回false
- word 分别转换为全部小写 wLower全部大写 wUpper首字母大写的字符串 wCaptial
- 判断 word 是否等于 wLower, wUpper, wCaptial 中的一个,如果是返回 true否则返回 false
## 代码
```go
package leetcode
import "strings"
@ -62,4 +64,5 @@ func detectCapitalUse(word string) bool {
}
return false
}
```