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.
stringhackerrankInString(strings){// Complete this functionintss[]={104,97,99,107,101,114,114,97,110,107};intss_l=10;intss_ind=0;for(inti=0;i<s.size()&&ss_ind<ss_l;i++){if(ss_ind<ss_l&&(int)s[i]==ss[ss_ind]){ss_ind++;}}return(ss_ind==ss_l)?"YES":"NO";}
HackerRank in a String!
You are viewing a single comment's thread. Return to all comments →
Yep, ended up with the same in C++ also: