Skip to content

Instantly share code, notes, and snippets.

@RadwaKamal
Created March 30, 2026 11:08
Show Gist options
  • Select an option

  • Save RadwaKamal/6f499462edd6776fc91e1283c2b096f2 to your computer and use it in GitHub Desktop.

Select an option

Save RadwaKamal/6f499462edd6776fc91e1283c2b096f2 to your computer and use it in GitHub Desktop.
Longest Substring Without Repeating Characters

Longest Substring Without Repeating Characters

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

Examples

"abcabcbb"  → 3  ("abc")
"bbbbb"     → 1  ("b")
"pwwkew"    → 3  ("wke")
""          → 0
" "         → 1
"au"        → 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment