Strong Password

  • + 0 comments
    def minimumNumber(n):
        low=1
        up=1
        di=1
        spl=1
    
        for i in n:
            if i.islower():
                low=0
            elif i.isupper():
                up=0
            elif i.isdigit():
                di=0
            elif i in '!@#$%^&*()-+':
                spl=0
        ans=low+up+di+spl
        if len(n)+ans<6:
            ans+=6-(len(n)+ans)
            
        return ans