Detect Capital
Easy · String
We define the usage of capitals in a word to be right when one of the following cases holds:
Given a string word, return true if the usage of capitals in it is right.
Example 1
Input: word = "USA" Output: true
Example 2
Input: word = "FlaG" Output: false
Constraints
- 1 <= word.length <= 100
- word consists of lowercase and uppercase English letters.
Starter code (python)
class Solution(object):
def detectCapitalUse(self, word):
"""
:type word: str
:rtype: bool
"""
Related problems
- Longest Substring Without Repeating Characters (Medium)
- Longest Palindromic Substring (Medium)
- Roman to Integer (Easy)
Previous: Super Washing Machines · Next: Longest Uncommon Subsequence I · All problems
Zepruv is a technical interview practice platform. Read any problem for free; sign in to run your code, submit and keep your progress.