1. public class Solution {
  2. public bool IsSubsequence(string s, string t) {
  3. var i = ;
  4. var j = ;
  5. while (i < s.Length && j < t.Length)
  6. {
  7. if (s[i] == t[j])
  8. {
  9. i++;
  10. j++;
  11. }
  12. else
  13. {
  14. j++;
  15. }
  16. }
  17.  
  18. if (i >= s.Length)
  19. {
  20. return true;
  21. }
  22. else
  23. {
  24. return false;
  25. }
  26. }
  27. }

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. Idea_00_资源贴

    一.精选资料 tengj/IntelliJ-IDEA-Tutorial IntelliJ IDEA 使用教程-极客学院 二.参考资料 eclipse&Myeclipse&Intelli ...

  2. react use simditor

    1.install simditor 2.import simditor && scss import $ from "jquery" import Simdito ...

  3. New Concept English three (29)

    1听力和打字训练: 31w/m 54 typing errors Whether we find a joke funny or not largely depends on were we have ...

  4. New Concept English three (37)

    28 words/minute 44 typing errors We have learnt to expect that trains will be punctual. After years ...

  5. Python 多版本共存之pyenv

    经常遇到这样的情况: 系统自带的 Python 是 2.6,自己需要 Python 2.7 中的某些特性: 系统自带的 Python 是 2.x,自己需要 Python 3.x: 此时需要在系统中安装 ...

  6. Git commit 信息标准和丢弃必须要的commit

    /***************************************************************************** * Git commit 信息标准和丢弃必 ...

  7. Gradle配置IDEA正常识别JPA Metamodel Generator动态生成的代码

    我们在使用JPA动态查询构建查询条件时,为了实现安全的类型检查,常常需要引用Hibernate JPA Metamodel Generator自动为我们生成静态元模型类. 而这些类由于编译时由Hibe ...

  8. 一种 jquery 检索方案

    整理自:http://www.cnblogs.com/linjiqin/archive/2011/03/18/1988464.html <!DOCTYPE HTML PUBLIC "- ...

  9. 04:sqlalchemy操作数据库 不错

    目录: 1.1 ORM介绍(作用:不用原生SQL语句对数据库操作) 1.2 安装sqlalchemy并创建表 1.3 使用sqlalchemy对表基本操作 1.4 一对多外键关联 1.5 sqlalc ...

  10. 两种方式创建Maven项目【方式一】

    经常使用maven进行项目的管理,今天整理两种方式创建maven项目及创建过程中碰到的问题怎么解决: 方式一: 1.新建maven项目,点击下一步. 2.勾选Create a simple proje ...