Back to Browse

Longest Substring Without Repeating Characters Leetcode #3 ) | JS | Sliding Window | Apple |Amazon

93 views
Premiered Apr 12, 2024
19:29

๐Ÿ” Problem: We're tackling the "Longest Substring Without Repeating Characters" problem using JavaScript and discussing both brute force and optimal sliding window approaches. ๐Ÿง  Approach: Starting with a brute force method, we analyse its O(n^2) time complexity before introducing the efficient two-pointer approach with O(n) time complexity. ๐Ÿ’ป Coding Session: Follow along in this coding session as we implement both approaches step by step. Witness how sliding technique solves this optimally. ๐Ÿ“Ž Problem Link: https://leetcode.com/problems/longest-substring-without-repeating-characters/description/ ๐Ÿ”— Solution Link: https://github.com/mohanmanis/Lectures/blob/main/src/blind75/longestSubstringWithoutRepeatingCharacters.js ๐Ÿš€ Key Learnings: By understanding these approaches, you'll not only solve this problem but also gain insights into optimizing solutions for similar challenges. ๐Ÿ”” Don't forget to subscribe to my channel for more Blind 75 series tutorials! Hit the bell icon to stay updated with the latest content. Happy coding! ๐Ÿš€ โšก๏ธ Timestamps: 0:00 - Introduction 0:25 - What is substring/subarrays? 1:10 - Problem Overview 2:10 - Brute Force approach, O(n^2) 4:27 - Intuition of better approach 4:50 - Sliding Window Explanation 8:30 - General template of Sliding Window 10:00 - Dry run of brute force approach 13:23 - Coding Session: Using Map 18:07 - Coding Session: Using Set 12:45 - Conclusion & Subscribe #Algorithm #Coding #Blind75 #SlidingWindowApproach #JavaScriptTutorial #SubscribeNow #containerwithmostwater #slidingwindows ๐Ÿ“Š๐Ÿ’ป๐Ÿ”

Download

0 formats

No download links available.

Longest Substring Without Repeating Characters Leetcode #3 ) | JS | Sliding Window | Apple |Amazon | NatokHD