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
User's avatar

Continue reading this post for free, courtesy of Harpreet Singh.

Or purchase a paid subscription.
© 2026 Harpreet Singh · Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture