Search⌘ K
AI Features

Find Longest Self-Contained Substring

Find Longest Self-Contained Substring asks for the length of the longest substring that is not the whole string and has no character appearing outside it, or -1 if none.

Statement

You are given a string, s, consisting of lowercase English letters. Your task ...