You are viewing a single comment's thread. Return to all comments →
My recursive C++ solution
string _str( string & s, string & s1, int n1, int n2) { if (n1 == 0 || n2 == 0) { if( s[0]== s1[0] ) return "YES"; return "NO"; } if (s[n1] == s1[n2]) return "YES"; return _str(s, s1, n1 - 1, n2 - 1); } string twoStrings(string s1, string s2) { return _str(s1, s2, s1.size() - 1, s2.size() - 1); }
Seems like cookies are disabled on this browser, please enable them to open this website
Two Strings
You are viewing a single comment's thread. Return to all comments →
My recursive C++ solution