Ruby one-line solution


  • 0
    B
    def detect_capital_use(word)
      word == word.downcase || word == word.upcase || word == word.capitalize ? true : false
    end
    

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.