Sliding Window Algorithm - Longest Substring Without Repeating Characters (LeetCode)
►Support me on Patreon: https://www.patreon.com/michaelmuinos
Join the Discord channel by becoming a supporter on my Patreon!
In this Discord channel, you will be able to...
1. Contact me directly for interview prep advice, tech questions, project ideas, etc.
2. Discuss interview experiences with other members
3. Discuss technical questions with other members
4. Find mock interview partners & more!
Here is a step by step explanation of the algorithm problem "Longest Substring Without Repeating Characters" on the LeetCode platform. This problem is asked at many tech companies including Google, Facebook, Amazon, Uber, Adobe, and many more. In this tutorial video, I go over the sliding window technique.
A sliding window algorithm will form a window, or section, around parts of the data. Incrementally, this window will move over the data and perform some sort of computation. To solve it, we must initialize an i and j pointer mapping to our 0 index in our string. We also must initialize a set data structure to keep track of characters we have seen in our window and a max variable. We move the i pointer forward adding each character to our set. If the character is already in our set, we start moving our j pointer forward and removing at each step. After removals, we will compute the length of our window which is i - j + 1 and assign that value to our max variable.
The time and space complexity of our sliding window solution is O(N) where N is the number of characters we have in our input string.
⭐️ Timestamps ⭐️
00:00 - Introduction
00:25 - Problem Overview
00:54 - Brute Force Approach
01:30 - Sliding Window Overview
02:02 - Full Example Walk-through
06:39 - Code Walk-through
09:21 - Time and Space Complexity
►Follow me on Twitter: https://twitter.com/MichaelMuinos
►Follow me on Github: https://github.com/MichaelMuinos
----------------------------------------------------
Better Days by Lakey Inspired
https://soundcloud.com/lakeyinspired
https://www.youtube.com/channel/UCOmy8wuTpC95lefU5d1dt2Q
Видео Sliding Window Algorithm - Longest Substring Without Repeating Characters (LeetCode) канала Michael Muinos
Join the Discord channel by becoming a supporter on my Patreon!
In this Discord channel, you will be able to...
1. Contact me directly for interview prep advice, tech questions, project ideas, etc.
2. Discuss interview experiences with other members
3. Discuss technical questions with other members
4. Find mock interview partners & more!
Here is a step by step explanation of the algorithm problem "Longest Substring Without Repeating Characters" on the LeetCode platform. This problem is asked at many tech companies including Google, Facebook, Amazon, Uber, Adobe, and many more. In this tutorial video, I go over the sliding window technique.
A sliding window algorithm will form a window, or section, around parts of the data. Incrementally, this window will move over the data and perform some sort of computation. To solve it, we must initialize an i and j pointer mapping to our 0 index in our string. We also must initialize a set data structure to keep track of characters we have seen in our window and a max variable. We move the i pointer forward adding each character to our set. If the character is already in our set, we start moving our j pointer forward and removing at each step. After removals, we will compute the length of our window which is i - j + 1 and assign that value to our max variable.
The time and space complexity of our sliding window solution is O(N) where N is the number of characters we have in our input string.
⭐️ Timestamps ⭐️
00:00 - Introduction
00:25 - Problem Overview
00:54 - Brute Force Approach
01:30 - Sliding Window Overview
02:02 - Full Example Walk-through
06:39 - Code Walk-through
09:21 - Time and Space Complexity
►Follow me on Twitter: https://twitter.com/MichaelMuinos
►Follow me on Github: https://github.com/MichaelMuinos
----------------------------------------------------
Better Days by Lakey Inspired
https://soundcloud.com/lakeyinspired
https://www.youtube.com/channel/UCOmy8wuTpC95lefU5d1dt2Q
Видео Sliding Window Algorithm - Longest Substring Without Repeating Characters (LeetCode) канала Michael Muinos
Показать
Комментарии отсутствуют
Информация о видео
Другие видео канала
Sliding Window Technique - Algorithmic Mental ModelsPython Programming Practice: LeetCode #3 -- Longest Substring Without Repeating CharactersMinimum Window Substring | Sliding Window | LeetCodeTrie Data Structure Implementation (LeetCode)Longest Substring Without Repeating Characters SOLUTION (Leetcode #3)How Dream is beating the YouTube Algorithm (Genius Strategy)Longest Substring With Without Repeating Characters | Variable Size Sliding WindowLongest Common Subsequence (2 Strings) - Dynamic Programming & Competing SubproblemsAmazon Coding Interview Question - First Missing Positive (LeetCode)LeetCode Longest Substring Without Repeating Characters Solution Explained - JavaMinimum Window Substring: Utilizing Two Pointers & Tracking Character Mappings With A HashtableDesign Underground System - Bloomberg 2020 Most Asked Interview QuestionEp.6: Linked Lists - LeetCode Problems That Got Me HiredLongest Substring Without Repeating Characters | Leet code 3 | Theory explained + Python codeLongest Substring Without Repeating Characters | LeetCode 3 | Coding Interview TutorialTop K Frequent Words - Priority Queue Approach (LeetCode)Google Coding Interview Question - Number of Closed Islands (LeetCode)Leetcode problem Longest Palindromic Substring (two solutions)Amazon Coding Interview Question - Integer to Roman (LeetCode)Google Engineer Explains - LeetCode #3 - Longest Substring Without Repeat - Solution (Python)