LeetCode --- 1624. Largest Substring Between Two Equal Characters 解题报告

Posted 杨鑫newlfe

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了LeetCode --- 1624. Largest Substring Between Two Equal Characters 解题报告相关的知识,希望对你有一定的参考价值。

Given a string s, return the length of the longest substring between two equal characters, excluding the two characters. If there is no such substring return -1.

substring is a contiguous sequence of characters within a string.

Example 1:

Input: s = "aa"
Output: 0
Explanation: The optimal substring here is an empty substring between the two \'a\'s.

Example 2:

Input: s = "abca"
Output: 2
Explanation: The optimal substring here is "bc".

Example 3:

Input: s = "cbzxy"
Output: -1
Explanation: There are no characters that appear twice in s.

Constraints:

    以上是关于LeetCode --- 1624. Largest Substring Between Two Equal Characters 解题报告的主要内容,如果未能解决你的问题,请参考以下文章

    LeetCode --- 1624. Largest Substring Between Two Equal Characters 解题报告

    LeetCode --- 1624. Largest Substring Between Two Equal Characters 解题报告

    LeetCode 1624. 两个相同字符之间的最长子字符串 / 698. 划分为k个相等的子集 / 面试题 01.08. 零矩阵 / 1694. 重新格式化电话号码

    LeetCode 1624. 两个相同字符之间的最长子字符串 / 698. 划分为k个相等的子集 / 面试题 01.08. 零矩阵 / 1694. 重新格式化电话号码

    P1667 数列(置换&前缀和)

    hihocoder-1624-最短游览路线