AlgoPond
LearnPracticeMockPricing
AlgoPond

Master DSA patterns and ace your next technical interview.

Learn

  • Curriculum
  • Problems
  • Daily Challenge
  • Mock Interview

Account

  • Dashboard
  • Pricing
  • Sign In
  • Get Started

Company

  • Privacy Policy
  • Terms of Service

© 2026 AlgoPond. All rights reserved.

Built for engineers who ship.

mediumSliding Window

Longest Substring Without Repeating Characters

## Problem

Given a string `s`, find the length of the **longest substring** without repeating characters.

Examples

Input
s = "abcabcbb"
Output
3
"abc" is the longest substring without repeating characters.
Input
s = "bbbbb"
Output
1
"b" is the longest.
Input
s = "pwwkew"
Output
3
"wke" is the longest.

Constraints

0 <= s.length <= 5 * 10^4 s consists of English letters, digits, symbols and spaces.
Python
Loading...