Skip to content

[Algo] Longest Substring Without Repeating #50

@Jeanedlune

Description

@Jeanedlune

Problem: Longest Substring Without Repeating Characters

Find the length of the longest substring without repeating characters.

Given a string, find the length of the longest substring that contains no repeating characters.

Constraints

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

Example

Input: s = "abcabcbb"
Output: 3 (substring "abc")

Input: s = "bbbbb"
Output: 1 (substring "b")

Complexity

  • Time: O(n)
  • Space: O(min(m, n)) where m is charset size

Contribution Guidelines

  • Implement in one language (we'll add others later)
  • Include README with problem statement and test cases
  • Add test harness in your implementation
  • Follow code style guide in .gemini/styleguide.md

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions