C# - 1 line


  • 0

    well, it doesn't seem to be a good solution because it takes 112 ms...

        public bool DetectCapitalUse(string word) {
                return word == word.ToUpper() || word.Remove(0,1) == word.Remove(0,1).ToLower();
        }
    }
    

Log in to reply
 

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