Back to problems

Longest Substring Without Repeating Characters

Algorithm · Amazon · Medium

Longest Substring Without Repeating Characters Medium · Topics · Company Tags · Hints Given a string s, return the length of the longest contiguous substring whose characters are all distinct (no character appears more than once). For an empty string, the result is 0. Example 1: Explanation: The substring "bac" (indices 1 through 3) contains no duplicate characters and has length 3. Example 2: Explanation: "bcadef" from index 1 to 6 is the longest substring with all unique…

Checking your access…