C# solution


  • 1
    Z

    For example:

    public class Solution {
        public bool DetectCapitalUse(string word) {
    
            if (word==word.ToUpper()||word==word.ToLower()) return true;
             else
             {
             string str = word.Substring(1);
             if(str==str.ToLower()) return true;
             }
             return false;
    
      
      }
    }
    

Log in to reply
 

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