←ENG-DSA-060Packet Data Compression (Sliding Window)
00:00
🐍 Python Idle
Mode:Web

Packet Data Compression (Sliding Window)

CompaniesCisco, Amazon
Est. Time~30 min
LevelMid
Sliding WindowHash MapStrings
🚨 P0 Incident
CiscoAmazon

LZ77 and LZ78 compression algorithms (used in gzip and PNG formats) scan streams of bytes looking for the longest sequences without duplicate characters. Efficiently finding the longest substring without repeating characters is a core sub-routine in stream compression logic.

πŸ“₯ Assigned to:You β€” Mid Engineer
Your Task

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

⏱ Time: O(N)πŸ’Ύ Space: O(min(N, charset))
Example 1
Input:Β Β s='abcabcbb'
Output:Β 3 ("abc")
Example 2
Input:Β Β s='bbbbb'
Output:Β 1 ("b")
πŸ”’ +3 hidden test cases β€” revealed on Submit
Hints
Loading editor…
Test Output
β–Ά Run Code to test against examples Β· Submit to judge all 5 test cases
EngPrep β€” Real Engineering. Real Interviews.