当前位置:网站首页>华为od-寻找相同子串
华为od-寻找相同子串
2022-07-16 19:49:00 【大鸡腿最好吃】
给你两个字符串 t 和 p ,要求从 t 中找到一个和 p 相同的连续子串,并输出该字串第一个字符的下标。
输入描述:
输入文件包括两行,分别表示字符串 t 和 p ,保证 t 的长度不小于 p ,且 t 的长度不超过1000000,p 的长度不超过10000。
输出描述:
如果能从 t 中找到一个和 p 相等的连续子串,则输出该子串第一个字符在t中的下标(下标从左到右依次为1,2,3,…);如果不能则输出”No”;如果含有多个这样的子串,则输出第一个字符下标最小的。
let a = readLine();
let b = readLine();
// let a = "AVERDXIVYERDIAN";
// let b = "RDXI";
if(a.length>1000000||b.length>a.length||b.length>10000){
console.log("No");
}
console.log(a.indexOf(b) == -1? "No" : a.indexOf(b)+1);边栏推荐
- Low code development builds business process management solutions
- Publication en niveaux de gris istio: déploiement du projet de microservice bookinfo
- Leetcode 1332. 删除回文子序列(看完题解才恍然大悟!!!!!!!)
- AcWing 396. Solution to the problem of mine construction (tarjan cut point)
- RPA生态系统大揭秘,支撑RPA企业数十亿估值的生命本源
- Istio灰度發布:部署Bookinfo微服務項目
- What are the main RPA manufacturers in the current mainstream
- 2022年协同办公系统(OA系统)选型对比参考
- Sword finger offer 10- ii Frog jumping on steps (4 solutions)
- 星巴克、可口可乐、苹果这些顶级企业是如何进行品牌营销
猜你喜欢

Neutral energy optimization of transport layer triple handshake

网络基础VlAN配置(eNSP、Cisco)

为什么mysql的count()方法这么慢?
![Sword finger offer 44 [a bit in the number sequence] [100%, 100%]](/img/fd/1d14ea8a1bdfbd53366d4781586797.png)
Sword finger offer 44 [a bit in the number sequence] [100%, 100%]

VS2017\VS2019\VS2022项目多余文件(中间文件\临时文件)一键清理BAT

Which brand of Bluetooth headset has good noise reduction? Top 10 active noise reduction headphones

App packet capturing tips how to break network exceptions?

Spark Streaming 编程指南

MySQL到底是如何执行SQL语句的

Dcat Admin 代码生成器应用(重新编辑)
随机推荐
Visual studio production environment configuration scheme: slowcheetah
Neutral energy optimization of transport layer triple handshake
pA是什么?构建病毒的结构元件,polyA,一段重复的碱基序列
容器内部查看服务状态报错:Failed to get D-Bus connection: Operation not permitted
[sequential reading and writing of data files in C language]
Win11怎么进行长截图?Win11长截图的方法
MySQL connection query
What kind of wireless Bluetooth headset is good? Bluetooth headset with the best comprehensive performance
Which kind of noise reduction Bluetooth headset is good? The most cost-effective active noise reduction Bluetooth headset
Dcat Admin 代码生成器应用(重新编辑)
Flutter is stuck in running gradle task 'assemblydebug' Solution of
Leetcode 1331. 数组序号转换
Network basic VLAN configuration (ENSP, Cisco)
华为 od js 拼接URL
深入剖析多重背包问题(下篇)
Leetcode 1331. Array sequence number conversion
C language - array
Application of Apache abox-700 industrial computer minipicecan card in electric power inspection robot
Lecture 4: round table seats
Ranking of top ten OA systems