MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / subsec

Function subsec

CPP/String/Check_Subsequence.cpp:4–14  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2using namespace std;
3
4bool subsec(string &s1, string &s2){
5 int n=s1.length();
6 int m=s2.length();
7 int j=0;
8 for(int i=0;i<n&&j<m;i++){
9 if(s1[i]==s2[j]){
10 j++;
11 }
12 }
13 return (j==m);
14}
15
16int main(){
17 string s1="germany";

Callers 1

mainFunction · 0.85

Calls 1

lengthMethod · 0.80

Tested by

no test coverage detected