leetcode392

Posted AsenYang

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了leetcode392相关的知识,希望对你有一定的参考价值。

public class Solution {
    public bool IsSubsequence(string s, string t) {
        var i = 0;
            var j = 0;
            while (i < s.Length && j < t.Length)
            {
                if (s[i] == t[j])
                {
                    i++;
                    j++;
                }
                else
                {
                    j++;
                }
            }

            if (i >= s.Length)
            {
                return true;
            }
            else
            {
                return false;
            }
    }
}

https://leetcode.com/problems/is-subsequence/#/description

以上是关于leetcode392的主要内容,如果未能解决你的问题,请参考以下文章

LeetCode 392. Is Subsequence

[leetcode-392-Is Subsequence]

LeetCode 392. Is Subsequence

[LeetCode] 392. Is Subsequence Java

Leetcode392. 判断子序列

LeetCode --- 392. Is Subsequence 解题报告