题解 | #藏宝图#

藏宝图

https://www.nowcoder.com/practice/74475ee28edb497c8aa4f8c370f08c30

using System;
using System.Collections.Generic;

public class Program {
    public static void Main() {
        string father = Console.ReadLine();
        char[] son = Console.ReadLine().ToCharArray();
        int i = 0;
        foreach(var v in father){
            if(v == son[i]){
                i++;
                if(i >= son.Length){
                    Console.WriteLine("Yes");
                    return;
                }
            }
        }
        Console.WriteLine("No");
    }
}

全部评论

相关推荐

强大的马里奥:不太可能,我校计算机硕士就业率99%
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务