leetcode392
- 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的更多相关文章
- [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 ...
- Leetcode392. Is Subsequence
Description Given a string s and a string t, check if s is subsequence of t. You may assume that the ...
- LeetCode392. 判断子序列
原题链接 1 class Solution: 2 def isSubsequence(self, s: str, t: str) -> bool: 3 lens,lent = len(s),le ...
随机推荐
- Idea_00_资源贴
一.精选资料 tengj/IntelliJ-IDEA-Tutorial IntelliJ IDEA 使用教程-极客学院 二.参考资料 eclipse&Myeclipse&Intelli ...
- react use simditor
1.install simditor 2.import simditor && scss import $ from "jquery" import Simdito ...
- 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 ...
- New Concept English three (37)
28 words/minute 44 typing errors We have learnt to expect that trains will be punctual. After years ...
- Python 多版本共存之pyenv
经常遇到这样的情况: 系统自带的 Python 是 2.6,自己需要 Python 2.7 中的某些特性: 系统自带的 Python 是 2.x,自己需要 Python 3.x: 此时需要在系统中安装 ...
- Git commit 信息标准和丢弃必须要的commit
/***************************************************************************** * Git commit 信息标准和丢弃必 ...
- Gradle配置IDEA正常识别JPA Metamodel Generator动态生成的代码
我们在使用JPA动态查询构建查询条件时,为了实现安全的类型检查,常常需要引用Hibernate JPA Metamodel Generator自动为我们生成静态元模型类. 而这些类由于编译时由Hibe ...
- 一种 jquery 检索方案
整理自:http://www.cnblogs.com/linjiqin/archive/2011/03/18/1988464.html <!DOCTYPE HTML PUBLIC "- ...
- 04:sqlalchemy操作数据库 不错
目录: 1.1 ORM介绍(作用:不用原生SQL语句对数据库操作) 1.2 安装sqlalchemy并创建表 1.3 使用sqlalchemy对表基本操作 1.4 一对多外键关联 1.5 sqlalc ...
- 两种方式创建Maven项目【方式一】
经常使用maven进行项目的管理,今天整理两种方式创建maven项目及创建过程中碰到的问题怎么解决: 方式一: 1.新建maven项目,点击下一步. 2.勾选Create a simple proje ...