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 ...
随机推荐
- SpringBoot_09_使用jar包中配置的Bean(starter配置)
一.前言 二.配置方式 在 META-INF/spring.factories 中声明主配置类,并开启bean的扫描 三.参考资料 1.Understanding auto-configured be ...
- 条款1:将c++视作一个语言联邦
c++是一个多重泛型编程语言,其所支持的泛型有: 面向过程编程(procedual) 面向对象编程(object-oriented) 面向函数编程(functional) 泛型编程(generic) ...
- L136
Newly formed blood vessels may contribute to eye disease: studyA study of Northwestern University (N ...
- L130
Trump Administration Backs Asian-Americans in Harvard CaseThe United States Justice Department on Th ...
- tf随笔-1
生成新的计算图,并完成常量初始化,在新的计算 图中完成加法计算 import tensorflow as tf g1=tf.Graph() with g1.as_default(): value=[1 ...
- python学习之控制语句
#if statement number=int(input("please input a number")); if number<10 : print("is ...
- 快排的python实现
快排的python实现 #python 2.7 def quick_sort(L): if len(L) <= 1: return L else: return quick_sort([lt f ...
- eclipse中package explore和project explore 怎么相互切换???
window--->show view--->other---->Java---->Package Explorer或者选project explore之后就可以相互切换了
- window如何分区
WD官方技术支持电话:800热线800-820-6682(请于周一至周五工作日期间使用固定电话拨打,不支持手机用户)手机用户请拨打400-627 6682. 链接:https://kuyusm.tma ...
- wlan经常掉线怎么办?
有没有这样的情款,好好的网络总是突然断掉然,之后就需要重新连接,连接以后没多久有需要重新连接.本次经验就来和大家一起分享一下几种情况的解决方法,非常的简单实用. 工具/原料 电脑 电源设置问题 1.本 ...