Longest Substring Without Repeating Characters — LeetCode 3 in Swift (ASMR Coding)
BomsamdiDev
0:00 / 0:00
Longest Substring Without Repeating Characters — LeetCode 3 in Swift (ASMR Coding)
1 просмотр · 11 дн. назад
BomsamdiDev
83 подписчика
1 просмотр · 11 дн. назад
Restarting from every character is quadratic. A window whose left edge only ever moves forward is not.
The longest run of characters with no repeats, in Swift: starting a fresh set at every position rereads the same characters over and over, while a sliding window with a map of last positions reads each character once and never moves backwards.
⏱ Chapters
00:00 The problem
00:37 The obvious way
01:28 What it costs
01:54 Watch the window slide
03:29 A window that only moves forward
04:21 Running the cases
🛠 Stack
Swift
Real, compiling code. Every project in these episodes builds, and anything
measured on screen was measured on camera.
#leetcode #algorithms #codinginterview #swift