DSA - Sliding Window - (In Progress)

The sliding window technique is a powerful approach used to solve a variety of problems, especially those involving subarrays or substrings. Here are the key characteristics and criteria to identify if a problem can be effectively solved using the sliding window technique: Characteristics of Sliding Window Problems Contiguous Subarrays or Subsequences: The problem involves finding a subarray or substring with certain properties, such as a fixed length or a sum within a range....

June 27, 2024 · 3 min · 617 words · Me

DSA - Two Pointer Approach - (In Progress)

The two-pointer approach is a powerful technique used to solve problems involving arrays or strings. Here are the key characteristics and criteria to identify if a problem can be effectively solved using the two-pointer approach: Characteristics of Two-Pointer Problems Sorted Input: The input array is sorted or can be easily sorted. Sorting often simplifies the problem and makes the two-pointer technique applicable. Finding Pairs or Subarrays: The problem involves finding pairs, triplets, or subarrays that satisfy specific conditions, such as a target sum....

June 27, 2024 · 7 min · 1405 words · Me