Harpreet's Newsletter

Harpreet's Newsletter

Longest Substring Without Repeating Characters

Google Interview Question

Harpreet Singh's avatar
Harpreet Singh
Oct 20, 2025
∙ Paid

Problem Overview

Difficulty: Medium
LeetCode Pattern: Sliding Window

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

Input: 
· s = “bbbbb”
Output: 
· 1
Explanation: 
· The answer is “b”
· It has length 1
Input: 
· s = "abcabcbb"
Output: 
· 3
Explanation: 
· The answer is "abc"
· It has length 3

Keep reading with a 7-day free trial

Subscribe to Harpreet's Newsletter to keep reading this post and get 7 days of free access to the full post archives.

Already a paid subscriber? Sign in
© 2025 Harpreet Singh · Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture