![](https://i-blog.csdnimg.cn/blog_migrate/b62b24329587d970553d2ffc78910f20.png)
class Solution {
public:
string dynamicPassword(string password, int target) {
string s1 = password.substr(0,target);
int j =0;
for(int i = 0;i<password.size();i++)
{
if(i<password.size()-target)
{
password[i] = password[i+target];
}
else
{
password[i] = s1[j++];
}
}
return password;
}
};
![](https://i-blog.csdnimg.cn/blog_migrate/7640be6bd050efb0f540554719a93ced.png)
class Solution {
public:
bool isSubsequence(string s, string t) {
int n = s.size();
int m = t.size();
int i = 0 , j = 0;
while(i<n && j<m)
{
if(s[i]==t[j])
{
i++;
}
j++;
}
if(i == n) return true;
return false;
}
};