Solved leetcode problem: Longest Substring Without Repeating Characters Approach: Use a set to maintain unique characters in the current window. Expand with r. If duplicate appears → shrink from l until valid. Track max window length. Consistent pattern practice > memorizing solutions. #LeetCode #SlidingWindow #Python #DSA #CodingInterview
LeetCode Solution: Longest Substring Without Repeating Characters
More Relevant Posts
-
Solved the Minimum Window Substring problem using the Sliding Window technique. Goal: Find the smallest substring in s that contains all characters of p (including duplicates). Key Idea • Maintain character frequency • Expand window to include required characters • Shrink window to get the minimum valid substring Time Complexity: O(n) #geekstreak60 #npci #algorithms #datastructures #python #slidingwindow #codingpractice #problemSolving #100DaysOfCode
To view or add a comment, sign in
-
-
feb-22-26 LeetCode 762 – Prime Number of Set Bits in Binary Representation Solved today’s problem! ✅ The task is to count numbers in a given range [left, right] whose number of set bits (1s in binary form) is a prime number. ⚡ Complexity: Time: O(n log n) Space: O(1) A simple yet powerful problem combining binary operations and number theory 🔥 #LeetCode #DailyCoding #BitManipulation #Python #ProblemSolving #CodingJourney
To view or add a comment, sign in
-
-
LeetCode 796 | Rotate String 🔁 🔹 Concept: String Rotation 🔹 Trick: Check if goal is substring of s + s 🔹 Time Complexity: O(n) All rotations of a string exist inside its doubled version 💡 Simple idea, powerful pattern. #LeetCode #DSA #StringManipulation #Python #CodingPractice #ProblemSolving
To view or add a comment, sign in
-
LeetCode #230 – Kth Smallest Element in a BST | Python Implementation I implemented an iterative inorder traversal using a stack to find the kth smallest element without building the entire sorted list. Core Insight: Iterative inorder traversal with early termination avoids O(n) space for storing all values. The stack simulates recursion while the counter enables stopping exactly at k. Time: O(h + k) where h = tree height | Space: O(h) for stack #LeetCode #DataStructures #Python #BinarySearchTree #InorderTraversal #Stack #CodingInterview #SoftwareEngineering
To view or add a comment, sign in
-
-
This challenge shows how list comprehensions can iterate through nested structures. The order of iteration matters here. Python processes the outer loop first and then the inner loop, flattening the structure step by step. This concept is widely used when working with matrices or nested lists. THE ANSWER IS: B #Python #NestedLoops #PythonChallenge #ProblemSolving #LearningInPublic
To view or add a comment, sign in
-
-
🎥 Demo in action! Yesterday I shared screenshots of my Movie Recommendation System. Here’s a quick 50-second walkthrough of how it actually works. Select a movie → Instantly get 5 similar recommendations with posters. Built using: • Content-based filtering • CountVectorizer • Cosine similarity • Streamlit + Python Still improving it — next step: collaborative filtering. Would love your thoughts 🙌 #MachineLearning #Python #RecommendationSystem #StudentDeveloper
To view or add a comment, sign in
-
Day 37 of #100DaysOfCode 🚀 Built a Sorting Algorithm Visualizer using Python and Tkinter. It visually demonstrates how Bubble Sort works by animating the comparisons and swaps step by step. A fun way to understand algorithmsms, sometimes seeing the logic move makes learning much clearer. #Python #DSA #Algorithms #Tkinter #LearningInPublic #100DaysOfCoding
To view or add a comment, sign in
-
Get ready for a new 'Technically Speaking' episode, part 2 of the Mocking Responsibly series is live now! Our teammate Matt explores specialized mocking using the Python responses library. The walk-through compares this approach with general-purpose mocking, showing how tool-specific mocks can reduce coupling between tests and implementation details while allowing safer refactoring. Check it out here: https://lnkd.in/gDmBEpcP #UnitTesting #Python #SoftwareEngineering
To view or add a comment, sign in
-
378 two-segment combinations from a 3x3 grid, avoiding any connected ends. Ordered and colored by segment length. The sketch-a-day archives and tip jar are at: https://lnkd.in/dN-wXtc Code for this one at: https://lnkd.in/d9dFQUCi #Processing #Python #py5 #CreativeCoding
To view or add a comment, sign in
-
-
Day 1/100 – #100DaysOfCode 🚀 Solved a classic array problem: "Two Sum" in Python. Learned how checking every pair of elements helps find the indices whose sum equals the target value. Approach: 1. Iterate through the array using two loops. 2. Check every possible pair of elements. 3. If their sum equals the target, return their indices. 4. If no pair is found, return an empty list. Time Complexity: O(n²) Space Complexity: O(1) Starting strong and building consistency 💪 #Python #DSA #ProblemSolving #CodingJourney
To view or add a comment, sign in
-
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development