1477 LeetCode problem solution
LeetCode 1477 Find Two Non-overlapping Sub-arrays Each With Target Sum solution using Sliding Window and Prefix Minimum patterns. In this solution we have O(n) time and space complexity.
Read moreLeetCode 1477 Find Two Non-overlapping Sub-arrays Each With Target Sum solution using Sliding Window and Prefix Minimum patterns. In this solution we have O(n) time and space complexity.
Read moreLeetCode 1621 Number of Sets of K Non-Overlapping Line. Segments solution using combinatorics and endpoint transformation.
Read moreLeetCode 2472 Maximum Number of Non-overlapping Palindrome Substrings solution using Dynamic Programming and Palindrome Checking. The key idea is to check only palindromes of length k and k + 1 to find the maximum number of non-overlapping substrings efficiently.
Read moreLeetCode 560 Subarray Sum Equals K solution using Prefix Sum and Hash Map. For each prefix sum, we look for currentSum - k to count valid subarrays in O(n) time.
Read moreLeetCode 4002 Count Valid Sequences solution using Combinatorics and Complement Counting. Count all positive compositions and subtract all-odd sequences.
Read more