ByteByteGo logo
menuProblems List

Longest Substring With Unique Characters

Medium

Given a string, determine the length of its longest substring that consists only of unique characters.

Example:

Input: s = 'abcba'
Output: 3

Explanation: Substring "abc" is the longest substring of length 3 that contains unique characters ("cba" also fits this description).

You can practice coding exercises online by logging into bytebytego.com on your laptop.