problem

925. Long Pressed Name

solution1:

class Solution {
public:
bool isLongPressedName(string name, string typed) {
int i=, m=name.size(), n=typed.size();
for(int j=; j<n; ++j)
{
if(i<m && name[i]==typed[j]) i++;
else if(!j && typed[j]!=typed[j-]) return false;
}
return i==m;
}
};

参考

1. Leetcode_easy_925. Long Pressed Name;

2. discuss;

3. cnblogs;

【Leetcode_easy】925. Long Pressed Name的更多相关文章

  1. 【leetcode】925.Long Pressed Name

    题目如下: Your friend is typing his name into a keyboard.  Sometimes, when typing a character c, the key ...

  2. 【LeetCode】925. Long Pressed Name 解题报告(Python)

    作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 参考资料 日期 题目地址:https://leetc ...

  3. 【CodeForces】925 C.Big Secret 异或

    [题目]C.Big Secret [题意]给定数组b,求重排列b数组使其前缀异或和数组a单调递增.\(n \leq 10^5,1 \leq b_i \leq 2^{60}\). [算法]异或 为了拆位 ...

  4. 【Leetcode_easy】1021. Remove Outermost Parentheses

    problem 1021. Remove Outermost Parentheses 参考 1. Leetcode_easy_1021. Remove Outermost Parentheses; 完

  5. 【Leetcode_easy】1022. Sum of Root To Leaf Binary Numbers

    problem 1022. Sum of Root To Leaf Binary Numbers 参考 1. Leetcode_easy_1022. Sum of Root To Leaf Binar ...

  6. 【Leetcode_easy】1025. Divisor Game

    problem 1025. Divisor Game 参考 1. Leetcode_easy_1025. Divisor Game; 完

  7. 【Leetcode_easy】1029. Two City Scheduling

    problem 1029. Two City Scheduling 参考 1. Leetcode_easy_1029. Two City Scheduling; 完

  8. 【Leetcode_easy】1030. Matrix Cells in Distance Order

    problem 1030. Matrix Cells in Distance Order 参考 1. Leetcode_easy_1030. Matrix Cells in Distance Orde ...

  9. 【Leetcode_easy】1033. Moving Stones Until Consecutive

    problem 1033. Moving Stones Until Consecutive 参考 1. Leetcode_easy_1033. Moving Stones Until Consecut ...

随机推荐

  1. 2019-2020-1 20199302《Linux内核原理与分析》第五周作业

    一.用户态.内核态和中断 1.一般现代cpu都有几种不用的指令执行级别 2.在高执行级别下,代码可以执行特权指令,访问任意的物理地址,这种CPU执行级别就对应着内核态. 3.在相应的低级别执行状态下, ...

  2. elasticsearch7.x集群安装(含head、bigdesk、kibana插件)

    网址:https://www.elastic.co 192.168.14.239 es-node1192.168.14.240 es-node2192.168.14.241 es-node3 ==== ...

  3. Centos 下 Apache 原生 Hbase + Phoenix 集群安装(转载)

    前置条件 各软件版本:hadoop-2.7.7.hbase-2.1.5 .jdk1.8.0_211.zookeeper-3.4.10.apache-phoenix-5.0.0-HBase-2.0-bi ...

  4. Matlab中画图数学公式的输出格式

    1.可以在输出参数中选择 ('Interpreter', 'latex'). 2.字符序列中的数学表达式需用$$等形式括起来. 例子: text(6, 0.3, '$\leftarrow  y= 2^ ...

  5. video标签在浏览器不能使用的问题 ?

    之前video标签是可以用的,但是压缩之后在移动端可以用,在pc浏览器不可以用? 怎么解决? 这样的写法会报错  说是缺乏source  但是你加上source也没有用 <video src=& ...

  6. Guided Hacking DLL Injector 3.3

    Guided Hacking DLL Injector 3.3 https://guidedhacking.com/resources/guided-hacking-dll-injector.4/ I ...

  7. [转]IDE 、SATA、SCSI 的区别

    IDE IDE的英文全称为“Integrated Drive Electronics”,即“电子集成驱动器”,它的 本意是指把“硬盘控制器”与“盘体”集成在一起的硬盘驱动器 .把盘体与控制器集成在 一 ...

  8. Java性能分析神器-JProfiler详解(转)

    前段时间在给公司项目做性能分析,从简单的分析Log(GC log, postgrep log, hibernate statitistic),到通过AOP搜集软件运行数据,再到PET测试,感觉时间花了 ...

  9. 000 基于Spring boot发送邮件

    发送邮件的程序,使用QQ的服务器,经过测试,完全可行.可复现 一:准备工作 1.找到账号的授权码 这个是程序需要使用的. 在设置中查找. 2.新建项目的目录 二:完整的程序代码 1.pom.xml & ...

  10. 小D课堂 - 零基础入门SpringBoot2.X到实战_第9节 SpringBoot2.x整合Redis实战_37、分布式缓存Redis介绍

    笔记 1.分布式缓存Redis介绍      简介:讲解为什么要用缓存和介绍什么是Redis,新手练习工具          1.redis官网 https://redis.io/download   ...