Sign In
You are coding as a Guest. Sign in with your RoleNest account to permanently track your streak, earn XP, and climb the Campus Leaderboard!
Sign In with RoleNest
🔥Longest Substring Without Repeating CharactersMedium
DAILY PROBLEM OF THE DAY+50 XP • Daily Streak

Solve today's challenge or tackle one of the 3 Super Hard challenges for +150 XP.

MediumSliding Window•Acceptance: 34.8%

Longest Substring Without Repeating Characters

Targeted in FAANG & Tech OA:AmazonMicrosoftGoogleSwiggy
Real-World Engineering Context
High-throughput token sliding window parsing in streaming network packets and cryptographic nonces.
Given a string `s`, find the length of the longest substring without duplicate characters.

Sample Test Cases

Input: ["abcabcbb"]
Expected: 3
Input: ["bbbbb"]
Expected: 1
Input: ["pwwkew"]
Expected: 3
Input: [""]
Expected: 0

Constraints

  • 0 <= s.length <= 5 * 10^4
  • s consists of English letters, digits, symbols and spaces.
Recruiter Fast-Track ReferralVerified Candidate
Direct pipeline to Google, Amazon, Microsoft, Swiggy, & Uber recruiters
DevScore: 750/1000

Top DevScore profiles bypass resume screening filters. Every verified problem solve writes authentic proof-of-work to your profile and dispatches you directly into employer inboxes on RoleNest.