当前位置:网站首页>The longest child sequence of the 2019 Blue Bridge Cup
The longest child sequence of the 2019 Blue Bridge Cup
2022-06-23 00:54:00 【Stephen_ Curry___】
Topic link :
link : The longest subsequence .
Ideas
As soon as you see the longest subsequence, you can think of using the double pointer algorithm to solve it , The subject is very simple , Just simulate it .
C++ Code
#include<bits/stdc++.h>
using namespace std;
int main(){
string s1, s2;
cin >> s1 >> s2;
int len = 0;
for(int i = 0, j = 0; i < s1.size(); i++){
if(s1[i] == s2[j]){
j++;
len++;
}
}
cout << len;
return 0;
}
边栏推荐
- Leetcode question brushing - 715 Range module
- Flink synchronizes MySQL data to es
- Is it reliable to get new debts? Is it safe?
- Learn the specific technical learning experience of designing reusable software from the three levels of class, API and framework
- three. JS simulated driving tour art exhibition hall - creating super camera controller
- 最安全的现货白银的心理分析
- SAP ui5 application development tutorial 103 - how to consume third-party libraries in SAP ui5 applications
- 华为云招募工业智能领域合作伙伴,强力扶持+商业变现
- Graphite statsd interface data format description
- 層次選擇器
猜你喜欢

关于测试/开发程序员技术的一些思考,水平很高超的,混不下去了......

TiDB VS MySQL

Typecho imitation of Lu Songsong's blog theme template / Technology Information blog theme template
声网多人视频录制与合成支持掉线再录制 | 掘金技术征文

What is the storage structure and mode of data in the database?

How to refine permissions to buttons?

62. different paths

BGP联邦综合实验
Because I said: volatile is a lightweight synchronized, the interviewer asked me to go back and wait for the notice!

Installation record of ros1noetic in Win 11
随机推荐
最安全的现货白银的心理分析
Prevent others from using the browser to debug
工程目录导航
JS image resolution compression
股票在哪个平台买比较安全呢?
How to refine permissions to buttons?
#yyds干货盘点# 解决剑指offer:把二叉树打印成多行
OSPF综合实验
cadence SPB17.4 - 中文UI设置
EasyCVR硬件盒子如何设置断电自启动
Have you stepped on these pits? Use caution when creating indexes on time type columns
Shell view help
Using geTx to build a more elegant structure of flutter pages
OpenCvSharp (C# OpenCV) 微信QRCode解码功能使用介绍(附源码)
Thead safety experience
3dMax建模笔记(一):介绍3dMax和创建第一个模型Hello world
SAP UI5 应用开发教程之一百零二 - SAP UI5 应用的打印(Print)功能实现详解
Project directory navigation
07 project cost management
3DMAX modeling notes (I): introducing 3DMAX and creating the first model Hello World