MediumSliding Window· 62% acceptance
#559

Longest Substring Without Repeating 14

Medium

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

Example 1

Input: s = "cdefabcdefab"

Output: 6

Constraints

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

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

lengthOfLongestSubstring

← All practice problems