Ruby 1-liner Simple Solution (no regex)


  • 0
    F
    def detect_capital_use(word)
    	[ word.downcase, word.upcase, word.capitalize ].include? word
    end
    

Log in to reply
 

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