華為OD機試- 關(guān)聯(lián)子串
給定兩個字符串str1和str2,
str1進行排列組合只要有一個為str2的子串則認為str1是str2的關(guān)聯(lián)子串,
請返回子串在str2的起始位置,若不是關(guān)聯(lián)子串則返回-1。
示例1 輸入輸出示例僅供調(diào)試,后臺判題數(shù)據(jù)一般不包含示例
輸入
abc efghicbaiii
輸出
5
示例2 輸入輸出示例僅供調(diào)試,后臺判題數(shù)據(jù)一般不包含示例
輸入
abc efghiccaiii
輸出
-1
Java 實現(xiàn):https://renjie.blog.csdn.net/article/details/131594006
Python實現(xiàn):https://renjie.blog.csdn.net/article/details/128383409
C++ 實現(xiàn):https://renjie.blog.csdn.net/article/details/131594026
JavaScript實現(xiàn):https://renjie.blog.csdn.net/article/details/131594045
C實現(xiàn):https://renjie.blog.csdn.net/article/details/131621075
