Skip to content

Instantly share code, notes, and snippets.

@decagondev
Created April 23, 2025 21:10
Show Gist options
  • Save decagondev/f297a11423b62255ee63bbf503b9f624 to your computer and use it in GitHub Desktop.
Save decagondev/f297a11423b62255ee63bbf503b9f624 to your computer and use it in GitHub Desktop.

PROBLEM 1: Longest Substring Without Repeating Characters

Problem Statement

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

Concepts Covered

  • Sliding Window
  • Hashing
  • Two Pointers

Examples

Input: "abcabcbb"
Output: 3
Explanation: The answer is "abc", with the length of 3.

Input: "bbbbb"
Output: 1
Explanation: The answer is "b", with the length of 1.

Input: "pwwkew"
Output: 3
Explanation: The answer is "wke", with the length of 3.

Starter Code

def length_of_longest_substring(s: str) -> int:
    # Implement your solution here
    pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment