Tag: sliding_window
Longest Repeating Character Replacement - a faster approach
Date: 3/10/2024Tags:algorithmsleetcodesliding_windowThe code implements an algorithm that maintains the maximum window length by advancing the start pointer when needed, as the end pointer moves forward while comparing maxFreq with hashTB[s[end]] to track the new maximum character frequency for a problem related to replacing characters for Longest Repeating Character Replacement.
Longest Repeating Character Replacement
Date: 3/10/2024Tags:algorithmsleetcodesliding_windowThe journal entry explores the "Longest Repeating Character Replacement" problem, offering a binary search solution to find the length of the longest substring with the same letter by changing characters within a given limit, while delving further into related algorithms.
Longest Substring Without Repeating Characters - 3rd attemp
Date: 2/23/2024Tags:algorithmsleetcodesliding_windowThe journal entry discusses a new approach for finding the longest substring without repeating characters, using the sliding window technique and leveraging the `indexOf` function instead of a hash table for improved performance in the provided JavaScript code `lengthOfLongestSubstring(s: string): number`.
Permutation in String - count approach - 2nd attempt
Date: 2/13/2024Tags:algorithmsleetcodesliding_windowThis journal entry presents a revised solution using the sliding window technique with a count approach to determine if a permutation of string s1 exists within string s2, and includes the corresponding code implementation.
Permutation in String - hashArr approach - 2nd attempt
Date: 2/13/2024Tags:algorithmsleetcodesliding_windowThe journal entry discusses key insights on the sliding window technique and the `match` function, while also providing code for a permutation checking algorithm using hash arrays in JavaScript.