public class Solution {
public bool IsSubsequence(string s, string t) {
var i = ;
var j = ;
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的更多相关文章

  1. [Swift]LeetCode392. 判断子序列 | Is Subsequence

    Given a string s and a string t, check if s is subsequence of t. You may assume that there is only l ...

  2. Leetcode392. Is Subsequence

    Description Given a string s and a string t, check if s is subsequence of t. You may assume that the ...

  3. LeetCode392. 判断子序列

    原题链接 1 class Solution: 2 def isSubsequence(self, s: str, t: str) -> bool: 3 lens,lent = len(s),le ...

随机推荐

  1. 【spark】【问题】textFile找不到文件

    2018/5/9 关于textFile读取文件的问题 问题描述: 今天第一次使用spark-shell来读取文件,我在本地建立了一个text.txt文件,然后用textFile读取生成rdd. 但是执 ...

  2. New Concept English three (27)

    35w/m 67 It has been said that everyone lives by selling something. In the light of this statement, ...

  3. main(int argc, char *argv[])详解

    argc是命令行总的参数个数     argv[]是argc个参数,其中第0个参数是程序的全名,以后的参数     命令行后面跟的用户输入的参数,比如:     int   main(int   ar ...

  4. 高级C/C++编译技术之读书笔记(五)之动态库版本控制

    最近有幸阅读了<高级C/C++编译技术>深受启发,该书深入浅出地讲解了构建过程(编译.链接)中的各种细节,从多个角度展示了程序与库文件或代码的集成方法,提出了面向代码复用和系统集成的软件架 ...

  5. ORACLE PL/SQL编程之触发器

    8.1 触发器类型 8.1.1 DML触发器 8.1.2 替代触发器 8.1.3 系统触发器 8.2 创建触发器 8.2.1 触发器触发次序 8.2.2 创建DML触发器 8.2.3 创建替代(INS ...

  6. Android开源框架-Annotation框架(以ViewMapping注解为例)

    Annotation 分类 1 标准 Annotation 包括Override, Deprecated, SuppressWarnings,标准 Annotation 是指 Java 自带的几个 A ...

  7. WCF Restful 服务 Get/Post请求

    Restful  Get方式请求: Restful服务 Get请求方式:http://localhost:10718/Service1.svc/Get/A/B/C http://localhost:1 ...

  8. JS ready和onload事件 比较分析

    页面加载完成有两种事件: 一是ready,表示文档结构已经加载完成(不包含图片等非文字媒体文件); 二是onload,指示页 面包含图片等文件在内的所有元素都加载完成.(可以说:ready 在onlo ...

  9. AGC006 C Rabbit Exercise——思路(置换)

    题目:https://agc006.contest.atcoder.jp/tasks/agc006_c 选了 i 位置后 x[ i ] = x[ i-1 ] + x[ i+1 ] - x[ i ] . ...

  10. implicit declaration of function 'init_MUTEX'

    'init_MUTEX' 在新版本系统上已被淘汰 改用sema_init(sem, 1);