Sort by

recency

|

1912 Discussions

|

  • + 0 comments

    def camelcase(s): c = 1 for i in range(len(s)): if s[i] == s[i].upper(): c += 1 return c

  • + 0 comments

    My solution in java 15

    var sarr= s.split("(?=\p{Lu})"); return sarr.length;

  • + 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;
        }