Sort by

recency

|

1910 Discussions

|

  • + 0 comments
    def minimumNumber(n, password):
        # Return the minimum number of characters to make the password strong
        minLength = 6
        patterns = [r'[0-9]', r'[a-z]', r'[A-Z]', r'[!@#$%^&\*\(\)\-\+]']
        total_chars = sum([1 for pattern in patterns if not re.search(pattern, password)])
        total_chars += (0 if minLength <= n + total_chars else minLength - n - total_chars)
        return total_chars
    
  • + 0 comments

    my python solution

    def camelcase(s):

    tot = 1
    for char in s:
        if char.isupper():
            tot += 1
    return tot
    
  • + 0 comments

    My Java 8 Solution

    public static int camelcase(String s) {
            int count = 1;
            
            for (char c : s.toCharArray()) {
                if (Character.isUpperCase(c)) {
                    count++;
                }
            }
            
            return count;
        }
    
  • + 0 comments

    my cpp solution for this programme

    int camelcase(string s) {

    int count=1;  //  count=1 for min 1 word
    for(int i = 0;i <s.size();i++){ // loop lessthan size
        if(s[i] < 'a')   //if less than lowescase than count++
        count++;
    }
    
    return count;
    

    }

  • + 0 comments

    def camelcase(s): # Write your code here wordCount = 1 for i in s: if "A" <= i <= "Z": wordCount += 1

    return wordCount