Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int isSubsequence(char *s, char *sub)
- {
- if(!sub) return 1;
- if(!s) return 0;
- if(*s==*sub) return isSubsequence((s++),(sub++));
- return isSubsequence((s++), sub);
- }
- int main()
- {
- char s1[100], s2[100];
- gets(s1);
- gets(s2);
- printf("%d",isSubsequence(s1,s2));
- return 0;
- }
Add Comment
Please, Sign In to add comment