Sort by

recency

|

1914 Discussions

|

  • + 0 comments

    For Python3 Platform

    I wrote the code from scratch just to get more practice

    def camelcase(s):
        result = 1
        
        for i in s:
            if(i.isupper()):
                result = result + 1
        
        return result
    
    s = input()
    
    result = camelcase(s)
    
    print(result)
    
  • + 0 comments

    in javascript the solution for me was just a line:

    return s.split(/[A-Z]/).length

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