当前位置:网站首页>Huawei od search for the same substring
Huawei od search for the same substring
2022-07-18 22:16:00 【Big chicken legs are best】
Here are two for you character string t and p , Demand from t And one of them p The same continuous substring , And output the subscript of the first character of the string .
Input description :
The input file consists of two lines , Each represents a string t and p , Guarantee t The length of is not less than p , And t Not more than 1000000,p Not more than 10000.
Output description :
If you can get from t And one of them p Equal continuous substrings , Then the first character of the substring is output in t Subscript in ( The subscripts are... From left to right 1,2,3,…); Output if not ”No”; If there are multiple such substrings , The first character with the smallest subscript is output .
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);边栏推荐
- The author of surging issued the pressure test results
- The scroll up and down switch of the flutter text is used to prompt the announcement message
- Application of Apache E8 industrial computer minipicecan card in Construction Robot
- 鎳氫電池的特性和使用方法(FDK鎳氫電池充電機制)
- [UCOS III source code analysis] - Software Timer
- Caractéristiques et mode d'utilisation de la batterie ni MH (mécanisme de charge de la batterie ni MH FDK)
- [UCOS III source code analysis] - task creation
- 第四讲:圆桌座位
- Chapter 9.1 program design of MATLAB
- 如何在自动化测试中使用MitmProxy获取数据返回
猜你喜欢

Publication en niveaux de gris istio: déploiement du projet de microservice bookinfo

Practical application of machine learning: quickly brush five machine learning problems of Niuke

Leetcode 1332. Delete the palindrome subsequence (after reading the problem solution, you suddenly realize

蓝牙耳机哪个品牌降噪好?2022降噪耳机排行榜

Towhee 每日模型周报

动态规划之4种背包问题

Shuan Q, Dachang was forced to graduate and recited eight part essay for a month without a window. Fortunately, he got an offer

Information system project manager must recite the core examination site (44) planning risk response

剑指 Offer 10- II. 青蛙跳台阶问题(4种解法)

Leetcode 1342. 将数字变成 0 的操作次数
随机推荐
Inventory of major RPA products at home and abroad
How many QPS are your interfaces?
Win11预览版更新错误怎么办?Win11预览版安装失败的解决方法
C语言-数组
Towhee 每日模型周报
Lecture 4: round table seats
狂神redis笔记01
Linux solves the problem of oracle:ora-12537: tns:connection closed
AcWing 396. Solution to the problem of mine construction (tarjan cut point)
剑指 Offer 10- II. 青蛙跳台阶问题(4种解法)
华为 od js 拼接URL
动态规划之4种背包问题
Common usage of Arthas
Ranking of top ten OA systems
App packet capturing tips how to break network exceptions?
Why is the count () method of MySQL so slow?
阿里云、华为云、谷歌云都已入局,盘点13家云计算厂商的RPA
Leetcode 1331. 数组序号转换
Vs2017\vs2019\vs2022 project redundant files (intermediate files \ temporary files) one click clean bat
How to use mitmproxy to get data return in automated testing?