本文共 313 字,大约阅读时间需要 1 分钟。
class Solution {public: bool dfs(string& s,string& t,int L,int R){ if(L == s.length()) return true; if(R == t.length()) return false; if(s[L] == t[R]) return dfs(s,t,L+1,R+1); return dfs(s,t,L,R+1); } bool isSubsequence(string s, string t) { return dfs(s,t,0,0); }};
转载地址:http://ziwji.baihongyu.com/