We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
defminimumNumber(n,password):# Return the minimum number of characters to make the password strongs=list(password)lower_c=0upper_c=0char_c=0digit_c=0foriinrange(len(s)):ifs[i].isupper():upper_c=1elifs[i].islower():lower_c=1elifs[i].isdigit():digit_c=1elifs[i]in['!','@','#','$','%','^','&','*','(',')','-','+']:char_c=1final_counter=lower_c+upper_c+digit_c+char_ctypes_needed=4-final_counter# Calculate how many characters are needed to reach the minimum length of 6length_needed=max(0,6-n)
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Strong Password
You are viewing a single comment's thread. Return to all comments →