知识点字符串解题思路words中的单词都是有序出现在s中的,这道题就只需要将words中的单词拼接起来,运用indexOf找到第一次出现的下标即可。Java题解 import java.util.*; public class Solution { /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param s string字符串 * @param words string字符串一维数组 * @return int整型 */ public int findLongestSubstring (String s, String[] words) ...