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.
intminimumNumber(intn,stringpassword){// Return the minimum number of characters to make the password strongintd=0,l=0,u=0,s=0;for(constchar&c:password){if(c>='0'&&c<='9')++d;elseif(c>='a'&&c<='z')++l;elseif(c>='A'&&c<='Z')++u;else++s;}intr=0;if(d==0)++r;if(l==0)++r;if(u==0)++r;if(s==0)++r;returnmax(6-n,r);}
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 →
c++