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.
numbers={*"0123456789"}lower_case={*"abcdefghijklmnopqrstuvwxyz"}upper_case={*"ABCDEFGHIJKLMNOPQRSTUVWXYZ"}special_characters={*"!@#$%^&*()-+"}defminimumNumber(n:int,password:str)->int:# Return the minimum number of characters to make the password strongifn<3:return6-ncharacters={*password}returnmax(sum(not(characters&char_class)forchar_classin(numbers,lower_case,upper_case,special_characters)),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 →
Python 3: