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,stringPs){intd=0,uc=0,lc=0,sp=0,req;for(inti=0;i<n;i++){if(isdigit(Ps[i]))d=1;elseif(isupper(Ps[i]))uc=1;elseif(islower(Ps[i]))lc=1;elsesp=1;}//minimum no. of chars required to be added. req=4-(d+uc+lc+sp);if(n+req<6)//if resulting string is <6return6-n;elsereturnreq;}
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 →
Simple & efficient sol.