You are viewing a single comment's thread. Return to all comments →
string s2 = "hackerrank"; int len1 = s.length(); int len2 = s2.length(); int c=0,t=0,j; for(int i=0; i<len2; i++) { for(j=t;j<len1; j++) { t=j+1; if(s2[i] == s[j]) { c++; break; } } } if(c==len2) { return "YES"; } else { return "NO"; }
Seems like cookies are disabled on this browser, please enable them to open this website
HackerRank in a String!
You are viewing a single comment's thread. Return to all comments →