MediumSliding Window· 52% acceptance
#566

Longest Substring Without Repeating 21

Medium

Return the length of the longest substring without repeating characters. Variant **#21**.

Example 1

Input: s = "defabcdef"

Output: 6

Constraints

  • 0 <= s.length <= 5 * 10^4

Acceptance: 52% · Topics: sliding-window, hash-table, string

lengthOfLongestSubstring

← All practice problems