Search⌘ K
AI Features

Find Longest Self-Contained Substring

Find Longest Self-Contained Substring asks you to choose a substring that is not the whole string and whose characters appear nowhere outside it. Return its maximum length, or -1 if none exists.

Statement

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