392. 判断子序列 Is Subsequence

题目 https://leetcode-cn.com/problems/is-subsequence/

bool isSubsequence(char * s, char * t){
	if(s == NULL)
		return true;
	if(t == NULL)
		return false;

	while(*s!= '\x0' && *t != '\x0'){
		if(*s != *t){
			t++;
		}else{
			s++;
			t++;
		}
	}
	
	if(*s == '\x0')
		return true;
	else
		return false;
}

 

你可能感兴趣的:(C,LeetCode)