<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Manasi Patil</title>
    <description>The latest articles on Forem by Manasi Patil (@manasi_patil_).</description>
    <link>https://forem.com/manasi_patil_</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2609336%2Fe63113cd-bada-4d76-9ab9-50895c509a71.png</url>
      <title>Forem: Manasi Patil</title>
      <link>https://forem.com/manasi_patil_</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/manasi_patil_"/>
    <language>en</language>
    <item>
      <title>5 Linux Commands that makes you feel like a Hacker</title>
      <dc:creator>Manasi Patil</dc:creator>
      <pubDate>Tue, 03 Mar 2026 05:39:20 +0000</pubDate>
      <link>https://forem.com/manasi_patil_/5-linux-commands-that-makes-you-feel-like-a-hacker-2nn5</link>
      <guid>https://forem.com/manasi_patil_/5-linux-commands-that-makes-you-feel-like-a-hacker-2nn5</guid>
      <description>&lt;p&gt;5 Linux Commands that makes you feel like a Hacker &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;ranger - navigate and read your files&lt;/li&gt;
&lt;li&gt;lazygit - to see all the operations you performed on git&lt;/li&gt;
&lt;li&gt;lazydocker - to see all the containers running and all the operations on docker&lt;/li&gt;
&lt;li&gt;glances - to see all the process running on your machine&lt;/li&gt;
&lt;li&gt;cmatrix - provides you hacker like vibes&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;PS: you need to install them first on your system&lt;/p&gt;

</description>
      <category>linux</category>
      <category>ai</category>
      <category>devops</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Day 100 of 100 days dsa coding challenge</title>
      <dc:creator>Manasi Patil</dc:creator>
      <pubDate>Mon, 12 Jan 2026 05:43:33 +0000</pubDate>
      <link>https://forem.com/manasi_patil_/day-100-of-100-days-dsa-coding-challenge-254</link>
      <guid>https://forem.com/manasi_patil_/day-100-of-100-days-dsa-coding-challenge-254</guid>
      <description>&lt;p&gt;🔥 100 Days Completed! 🔥&lt;br&gt;
Taking on the GeeksforGeeks POTD challenge has been one of the best decisions — 100 days of consistency, learning, debugging, and levelling up! 💻🚀&lt;/p&gt;

&lt;p&gt;From tricky edge cases to satisfying ACs, every day taught me something new.&lt;br&gt;
Here’s to staying consistent and growing further — one problem at a time! 💪✨&lt;/p&gt;

&lt;h1&gt;
  
  
  100DaysOfCode #CodingChallenge #ProblemSolving #GeeksforGeeks #DeveloperJourney
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Problem:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
&lt;a href="https://www.geeksforgeeks.org/problems/maximum-of-all-subarrays-of-size-k3101/1" rel="noopener noreferrer"&gt;https://www.geeksforgeeks.org/problems/maximum-of-all-subarrays-of-size-k3101/1&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;K Sized Subarray Maximum&lt;/strong&gt;&lt;br&gt;
Difficulty: Medium   Accuracy: 26.04%&lt;br&gt;
Given an array arr[] of positive integers and an integer k. You have to find the maximum value for each contiguous subarray of size k. Return an array of maximum values corresponding to each contiguous subarray.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Examples:&lt;/strong&gt;&lt;br&gt;
Input: arr[] = [1, 2, 3, 1, 4, 5, 2, 3, 6], k = 3&lt;br&gt;
Output: [3, 3, 4, 5, 5, 5, 6]&lt;br&gt;
Explanation: &lt;br&gt;
1st contiguous subarray [1, 2, 3], max = 3&lt;br&gt;
2nd contiguous subarray [2, 3, 1], max = 3&lt;br&gt;
3rd contiguous subarray [3, 1, 4], max = 4&lt;br&gt;
4th contiguous subarray [1, 4, 5], max = 5&lt;br&gt;
5th contiguous subarray [4, 5, 2], max = 5&lt;br&gt;
6th contiguous subarray [5, 2, 3], max = 5&lt;br&gt;
7th contiguous subarray [2, 3, 6], max = 6&lt;/p&gt;

&lt;p&gt;Input: arr[] = [5, 1, 3, 4, 2], k = 1&lt;br&gt;
Output: [5, 1, 3, 4, 2]&lt;br&gt;
Explanation: When k = 1, each element in the array is its own subarray, so the output is simply the same array&lt;br&gt;
Constraints:&lt;br&gt;
1 ≤ arr.size() ≤ 106&lt;br&gt;
1 ≤ k ≤ arr.size()&lt;br&gt;
0 ≤ arr[i] ≤ 109&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;br&gt;
from collections import deque&lt;/p&gt;

&lt;p&gt;class Solution:&lt;br&gt;
    def maxOfSubarrays(self, arr, k):&lt;br&gt;
        dq = deque()&lt;br&gt;
        res = []&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    for i in range(len(arr)):
        if dq and dq[0] == i - k:
            dq.popleft()
        while dq and arr[dq[-1]] &amp;lt;= arr[i]:
            dq.pop()
        dq.append(i)
        if i &amp;gt;= k - 1:
            res.append(arr[dq[0]])

    return res
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>algorithms</category>
      <category>challenge</category>
      <category>devjournal</category>
      <category>showdev</category>
    </item>
    <item>
      <title>Day 99 of 100 days dsa coding challenge</title>
      <dc:creator>Manasi Patil</dc:creator>
      <pubDate>Sun, 11 Jan 2026 06:21:11 +0000</pubDate>
      <link>https://forem.com/manasi_patil_/day-99-of-100-days-dsa-coding-challenge-4pk0</link>
      <guid>https://forem.com/manasi_patil_/day-99-of-100-days-dsa-coding-challenge-4pk0</guid>
      <description>&lt;p&gt;Taking on a new challenge: solving GeeksforGeeks POTD daily and sharing my solutions! 💻🔥&lt;br&gt;
The goal: sharpen problem-solving skills, level up coding, and learn something new every day. Follow my journey! 🚀&lt;/p&gt;

&lt;h1&gt;
  
  
  100DaysOfCode #CodingChallenge #ProblemSolving #GeeksforGeeks #DeveloperJourney
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Problem:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
&lt;a href="https://www.geeksforgeeks.org/problems/minimum-window-subsequence/1" rel="noopener noreferrer"&gt;https://www.geeksforgeeks.org/problems/minimum-window-subsequence/1&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Minimum Window Subsequence&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Difficulty: Medium  Accuracy: 49.43%&lt;/p&gt;

&lt;p&gt;You are given two strings, s1 and s2. Your task is to find the smallest substring in s1 such that s2 appears as a subsequence within that substring.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; The characters of s2 must appear in the same sequence within the substring of s1.&lt;/li&gt;
&lt;li&gt; If there are multiple valid substrings of the same minimum length, return the one that appears first in s1.&lt;/li&gt;
&lt;li&gt; If no such substring exists, return an empty string.
Note: Both the strings contain only lowercase english letters.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Examples:&lt;/strong&gt;&lt;br&gt;
Input: s1 = "geeksforgeeks", s2 = "eksrg"&lt;br&gt;
Output: "eksforg"&lt;br&gt;
Explanation: "eksforg" satisfies all required conditions. s2 is its subsequence and it is smallest and leftmost among all possible valid substrings of s1.&lt;br&gt;
Input: s1 = "abcdebdde", s2 = "bde" &lt;br&gt;
Output: "bcde"&lt;br&gt;
Explanation:  "bcde" and "bdde" are two substring of s1 where s2 occurs as subsequence but "bcde" occur first so we return that.&lt;/p&gt;

&lt;p&gt;Input: s1 = "ad", s2 = "b" &lt;br&gt;
Output: ""&lt;br&gt;
Explanation: There is no substring exists.&lt;br&gt;
Constraints:&lt;br&gt;
1 ≤ s1.length ≤ 104&lt;br&gt;
1 ≤ s2.length ≤ 50&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;br&gt;
class Solution:&lt;br&gt;
    def minWindow(self, s1, s2):&lt;br&gt;
        n,m=len(s1),len(s2)&lt;br&gt;
        inf = 10**9&lt;br&gt;
        dp = {}&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    def solve(i,j):
        if j==m:
            return i

        if i==n:
            return inf

        if (i,j) in dp:
            return dp[(i,j)]

        if s1[i]==s2[j]:
            dp[(i,j)] = solve(i+1,j+1)
        else:
            dp[(i,j)] = solve(i+1,j)
        return dp[(i,j)]

    start=-1
    min_ = inf

    for i in range(n):
        if s1[i]==s2[0]:
            end = solve(i,0)
            if end!=inf and end-i&amp;lt;min_:
                min_ = end-i
                start = i

    return "" if start==-1 else s1[start:start+min_]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt; &lt;/p&gt;

</description>
    </item>
    <item>
      <title>Day 98 of 100 days dsa coding challenge</title>
      <dc:creator>Manasi Patil</dc:creator>
      <pubDate>Sat, 10 Jan 2026 17:01:59 +0000</pubDate>
      <link>https://forem.com/manasi_patil_/day-98-of-100-days-dsa-coding-challenge-37bm</link>
      <guid>https://forem.com/manasi_patil_/day-98-of-100-days-dsa-coding-challenge-37bm</guid>
      <description>&lt;p&gt;Taking on a new challenge: solving GeeksforGeeks POTD daily and sharing my solutions! 💻🔥&lt;br&gt;
The goal: sharpen problem-solving skills, level up coding, and learn something new every day. Follow my journey! 🚀&lt;/p&gt;

&lt;h1&gt;
  
  
  100DaysOfCode #CodingChallenge #ProblemSolving #GeeksforGeeks #DeveloperJourney
&lt;/h1&gt;

&lt;p&gt;Problem:&lt;br&gt;&lt;br&gt;
&lt;a href="https://www.geeksforgeeks.org/problems/count-number-of-substrings4528/1" rel="noopener noreferrer"&gt;https://www.geeksforgeeks.org/problems/count-number-of-substrings4528/1&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Substrings with K Distinct&lt;br&gt;
Difficulty: Medium   Accuracy: 20.46%&lt;br&gt;
You are given a string s consisting of lowercase characters and an integer k, You have to count all possible substrings that have exactly k distinct characters.&lt;br&gt;
Examples :&lt;br&gt;
Input: s = "abc", k = 2&lt;br&gt;
Output: 2&lt;br&gt;
Explanation: Possible substrings are ["ab", "bc"]&lt;br&gt;
Input: s = "aba", k = 2&lt;br&gt;
Output: 3&lt;br&gt;
Explanation: Possible substrings are ["ab", "ba", "aba"]&lt;br&gt;
Input: s = "aa", k = 1&lt;br&gt;
Output: 3&lt;br&gt;
Explanation: Possible substrings are ["a", "a", "aa"]&lt;br&gt;
Constraints:&lt;br&gt;
1 ≤ s.size() ≤ 106&lt;br&gt;
1 ≤ k ≤ 26&lt;/p&gt;

&lt;p&gt;Solution:&lt;br&gt;
class Solution:&lt;br&gt;
    def countSubstr(self, s, k):&lt;br&gt;
        return self.atMost(s, k) - self.atMost(s, k - 1)&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def atMost(self, s, k):
    if k == 0:
        return 0

    count = {}
    left = 0
    res = 0

    for right in range(len(s)):
        count[s[right]] = count.get(s[right], 0) + 1

        while len(count) &amp;gt; k:
            count[s[left]] -= 1
            if count[s[left]] == 0:
                del count[s[left]]
            left += 1

        res += right - left + 1

    return res
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
    </item>
    <item>
      <title>Day 97 of 100 days dsa coding challenge</title>
      <dc:creator>Manasi Patil</dc:creator>
      <pubDate>Fri, 09 Jan 2026 02:23:02 +0000</pubDate>
      <link>https://forem.com/manasi_patil_/day-97-of-100-days-dsa-coding-challenge-3bif</link>
      <guid>https://forem.com/manasi_patil_/day-97-of-100-days-dsa-coding-challenge-3bif</guid>
      <description>&lt;p&gt;Taking on a new challenge: solving GeeksforGeeks POTD daily and sharing my solutions! 💻🔥&lt;br&gt;
The goal: sharpen problem-solving skills, level up coding, and learn something new every day. Follow my journey! 🚀&lt;/p&gt;

&lt;h1&gt;
  
  
  100DaysOfCode #CodingChallenge #ProblemSolving #GeeksforGeeks #DeveloperJourney
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Problem:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
&lt;a href="https://www.geeksforgeeks.org/problems/subarrays-with-at-most-k-distinct-integers/1" rel="noopener noreferrer"&gt;https://www.geeksforgeeks.org/problems/subarrays-with-at-most-k-distinct-integers/1&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Subarrays With At Most K Distinct Integers&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Difficulty: Medium  Accuracy: 62.09%&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You are given an array arr[] of positive integers and an integer k, find the number of subarrays in arr[] where the count of distinct integers is at most k.&lt;br&gt;
Note: A subarray is a contiguous part of an array.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Examples:&lt;/strong&gt;&lt;br&gt;
Input: arr[] = [1, 2, 2, 3], k = 2&lt;br&gt;
Output: 9&lt;br&gt;
Explanation: Subarrays with at most 2 distinct elements are: [1], [2], [2], [3], [1, 2], [2, 2], [2, 3], [1, 2, 2] and [2, 2, 3].&lt;br&gt;
Input: arr[] = [1, 1, 1], k = 1&lt;br&gt;
Output: 6&lt;br&gt;
Explanation: Subarrays with at most 1 distinct element are: [1], [1], [1], [1, 1], [1, 1] and [1, 1, 1].&lt;br&gt;
Input: arr[] = [1, 2, 1, 1, 3, 3, 4, 2, 1], k = 2&lt;br&gt;
Output: 24&lt;br&gt;
Explanation: There are 24 subarrays with at most 2 distinct elements.&lt;br&gt;
Constraints:&lt;br&gt;
1 ≤ arr.size() ≤ 2*104&lt;br&gt;
1 ≤ k ≤ 2*104&lt;br&gt;
1 ≤ arr[i] ≤ 109&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;br&gt;
class Solution:&lt;br&gt;
     def countAtMostK(self, arr, k):&lt;br&gt;
        # Code here&lt;br&gt;
        from collections import Counter&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    cnt = Counter()
    left = 0
    ans = 0

    for r, e in enumerate(arr):
        cnt[e] += 1
        while len(cnt) &amp;gt; k and left &amp;lt;= r:
            cnt[arr[left]] -= 1
            if cnt[arr[left]] == 0:
                cnt.pop(arr[left])
            left += 1
        ans += r-left+1
    return ans
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
    </item>
    <item>
      <title>Day 96 of 100 days dsa coding challenge</title>
      <dc:creator>Manasi Patil</dc:creator>
      <pubDate>Thu, 08 Jan 2026 02:35:30 +0000</pubDate>
      <link>https://forem.com/manasi_patil_/day-96-of-100-days-dsa-coding-challenge-4mce</link>
      <guid>https://forem.com/manasi_patil_/day-96-of-100-days-dsa-coding-challenge-4mce</guid>
      <description>&lt;p&gt;Taking on a new challenge: solving GeeksforGeeks POTD daily and sharing my solutions! 💻🔥&lt;br&gt;
The goal: sharpen problem-solving skills, level up coding, and learn something new every day. Follow my journey! 🚀&lt;/p&gt;

&lt;h1&gt;
  
  
  100DaysOfCode #CodingChallenge #ProblemSolving #GeeksforGeeks #DeveloperJourney
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Problem:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
&lt;a href="https://www.geeksforgeeks.org/problems/count-subarray-with-k-odds/1" rel="noopener noreferrer"&gt;https://www.geeksforgeeks.org/problems/count-subarray-with-k-odds/1&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Count Subarray with k odds&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Difficulty: Medium   Accuracy: 53.77%&lt;/p&gt;

&lt;p&gt;You are given an array arr[] of positive integers and an integer k. You have to count the number of subarrays that contain exactly k odd numbers.&lt;br&gt;
Examples:&lt;br&gt;
Input: arr[] = [2, 5, 6, 9], k = 2&lt;br&gt;
Output: 2&lt;br&gt;
Explanation: There are 2 subarrays with 2 odds: [2, 5, 6, 9] and [5, 6, 9].&lt;br&gt;
Input: arr[] = [2, 2, 5, 6, 9, 2, 11], k = 2&lt;br&gt;
Output: 8&lt;br&gt;
Explanation: There are 8 subarrays with 2 odds: [2, 2, 5, 6, 9], [2, 5, 6, 9], [5, 6, 9], [2, 2, 5, 6, 9, 2], [2, 5, 6, 9, 2], [5, 6, 9, 2], [6, 9, 2, 11] and [9, 2, 11].&lt;br&gt;
Constraint:&lt;br&gt;
1 ≤ k ≤ arr.size() ≤ 105&lt;br&gt;
1 ≤ arr[i] ≤ 109&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;br&gt;
class Solution:&lt;br&gt;
    def countSubarrays(self, arr, k):&lt;br&gt;
        mp = {0: 1}&lt;br&gt;
        prefix = 0&lt;br&gt;
        ans = 0&lt;br&gt;
        for x in arr:&lt;br&gt;
            prefix += (x &amp;amp; 1)&lt;br&gt;
            if prefix - k in mp:&lt;br&gt;
                ans += mp[prefix - k]&lt;br&gt;
            mp[prefix] = mp.get(prefix, 0) + 1&lt;br&gt;
        return ans&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Day 95 of 100 days dsa coding challenge</title>
      <dc:creator>Manasi Patil</dc:creator>
      <pubDate>Wed, 07 Jan 2026 06:25:09 +0000</pubDate>
      <link>https://forem.com/manasi_patil_/day-95-of-100-days-dsa-coding-challenge-3ahl</link>
      <guid>https://forem.com/manasi_patil_/day-95-of-100-days-dsa-coding-challenge-3ahl</guid>
      <description>&lt;p&gt;Taking on a new challenge: solving GeeksforGeeks POTD daily and sharing my solutions! 💻🔥&lt;br&gt;
The goal: sharpen problem-solving skills, level up coding, and learn something new every day. Follow my journey! 🚀&lt;/p&gt;

&lt;h1&gt;
  
  
  100DaysOfCode #CodingChallenge #ProblemSolving #GeeksforGeeks #DeveloperJourney
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Problem:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
&lt;a href="https://www.geeksforgeeks.org/problems/count-distinct-elements-in-every-window/1" rel="noopener noreferrer"&gt;https://www.geeksforgeeks.org/problems/count-distinct-elements-in-every-window/1&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Count distinct elements in every window&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Difficulty: Medium  Accuracy: 41.83%&lt;/p&gt;

&lt;p&gt;Given an integer array arr[] and a number k. Find the count of distinct elements in every window of size k in the array.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Examples:&lt;/strong&gt;&lt;br&gt;
Input: arr[] = [1, 2, 1, 3, 4, 2, 3], k = 4&lt;br&gt;
Output: [3, 4, 4, 3]&lt;br&gt;
Explanation:&lt;br&gt;
First window is [1, 2, 1, 3], count of distinct numbers is 3.&lt;br&gt;
Second window is [2, 1, 3, 4] count of distinct numbers is 4.&lt;br&gt;
Third window is [1, 3, 4, 2] count of distinct numbers is 4.&lt;br&gt;
Fourth window is [3, 4, 2, 3] count of distinct numbers is 3.&lt;br&gt;
Input: arr[] = [4, 1, 1], k = 2&lt;br&gt;
Output: [2, 1]&lt;br&gt;
Explanation:&lt;br&gt;
First window is [4, 1], count of distinct numbers is 2.&lt;br&gt;
Second window is [1, 1], count of distinct numbers is 1.&lt;br&gt;
Input: arr[] = [1, 1, 1, 1, 1], k = 3&lt;br&gt;
Output: [1, 1, 1]&lt;br&gt;
Explanation: Every window of size 3 in the array [1, 1, 1, 1, 1], contains only the element 1, so the number of distinct elements in each window is 1.&lt;br&gt;
Constraints:&lt;br&gt;
1 ≤ k ≤ arr.size() ≤ 105&lt;br&gt;
1 ≤ arr[i] ≤ 105&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;br&gt;
class Solution:&lt;br&gt;
    def countDistinct(self, arr, k):&lt;br&gt;
        from collections import defaultdict&lt;br&gt;
        freq = defaultdict(int)&lt;br&gt;
        res = []&lt;br&gt;
        n = len(arr)&lt;br&gt;
        for i in range(k):&lt;br&gt;
            freq[arr[i]] += 1&lt;br&gt;
        res.append(len(freq))&lt;br&gt;
        for i in range(k, n):&lt;br&gt;
            freq[arr[i-k]] -= 1&lt;br&gt;
            if freq[arr[i-k]] == 0:&lt;br&gt;
                del freq[arr[i-k]]&lt;br&gt;
            freq[arr[i]] += 1&lt;br&gt;
            res.append(len(freq))&lt;br&gt;
        return res&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Day 94 of 100 days dsa coding challenge</title>
      <dc:creator>Manasi Patil</dc:creator>
      <pubDate>Tue, 06 Jan 2026 04:36:47 +0000</pubDate>
      <link>https://forem.com/manasi_patil_/day-94-of-100-days-dsa-coding-challenge-5ahp</link>
      <guid>https://forem.com/manasi_patil_/day-94-of-100-days-dsa-coding-challenge-5ahp</guid>
      <description>&lt;p&gt;Taking on a new challenge: solving GeeksforGeeks POTD daily and sharing my solutions! 💻🔥&lt;br&gt;
The goal: sharpen problem-solving skills, level up coding, and learn something new every day. Follow my journey! 🚀&lt;/p&gt;

&lt;h1&gt;
  
  
  100DaysOfCode #CodingChallenge #ProblemSolving #GeeksforGeeks #DeveloperJourney
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Problem:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
&lt;a href="https://www.geeksforgeeks.org/problems/max-xor-subarray-of-size-k/1" rel="noopener noreferrer"&gt;https://www.geeksforgeeks.org/problems/max-xor-subarray-of-size-k/1&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Max Xor Subarray of size K&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Difficulty: Medium  Accuracy: 70.74%&lt;/p&gt;

&lt;p&gt;Given an array of integers arr[]  and a number k. Return the maximum xor of a subarray of size k.&lt;br&gt;
Note: A subarray is a contiguous part of any given array.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Examples:&lt;/strong&gt;&lt;br&gt;
Input: arr[] = [2, 5, 8, 1, 1, 3], k = 3&lt;br&gt;
Output: 15&lt;br&gt;
Explanation: arr[0] ^ arr[1] ^ arr[2] = 15, which is maximum.&lt;br&gt;
Input: arr[] = [1, 2, 4, 5, 6] , k = 2&lt;br&gt;
Output: 6&lt;br&gt;
Explanation: arr[1] ^ arr[2] = 6, which is maximum.&lt;br&gt;
Constraints:&lt;br&gt;
1 ≤ arr.size() ≤ 106&lt;br&gt;
0 ≤ arr[i] ≤ 106&lt;br&gt;
1 ≤ k ≤ arr.size()&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;br&gt;
class Solution:&lt;br&gt;
    def maxSubarrayXOR(self, arr, k):&lt;br&gt;
        n = len(arr)&lt;br&gt;
        xr = 0&lt;br&gt;
        for i in range(k):&lt;br&gt;
            xr ^= arr[i]&lt;br&gt;
        ans = xr&lt;br&gt;
        for i in range(k, n):&lt;br&gt;
            xr ^= arr[i-k]&lt;br&gt;
            xr ^= arr[i]&lt;br&gt;
            ans = max(ans, xr)&lt;br&gt;
        return ans&lt;/p&gt;

</description>
      <category>algorithms</category>
      <category>devjournal</category>
      <category>showdev</category>
    </item>
    <item>
      <title>Day 93 of 100 days dsa coding challenge</title>
      <dc:creator>Manasi Patil</dc:creator>
      <pubDate>Mon, 05 Jan 2026 03:09:33 +0000</pubDate>
      <link>https://forem.com/manasi_patil_/day-93-of-100-days-dsa-coding-challenge-5cla</link>
      <guid>https://forem.com/manasi_patil_/day-93-of-100-days-dsa-coding-challenge-5cla</guid>
      <description>&lt;p&gt;Taking on a new challenge: solving GeeksforGeeks POTD daily and sharing my solutions! 💻🔥&lt;br&gt;
The goal: sharpen problem-solving skills, level up coding, and learn something new every day. Follow my journey! 🚀&lt;/p&gt;

&lt;h1&gt;
  
  
  100DaysOfCode #CodingChallenge #ProblemSolving #GeeksforGeeks #DeveloperJourney
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Problem:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
&lt;a href="https://www.geeksforgeeks.org/problems/max-sum-subarray-of-size-k5313/1" rel="noopener noreferrer"&gt;https://www.geeksforgeeks.org/problems/max-sum-subarray-of-size-k5313/1&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Max Sum Subarray of size K&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Difficulty: Easy  Accuracy: 49.6%&lt;/p&gt;

&lt;p&gt;Given an array of integers arr[]  and a number k. Return the maximum sum of a subarray of size k.&lt;br&gt;
Note: A subarray is a contiguous part of any given array.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Examples:&lt;/strong&gt;&lt;br&gt;
Input: arr[] = [100, 200, 300, 400], k = 2&lt;br&gt;
Output: 700&lt;br&gt;
Explanation: arr2 + arr3 = 700, which is maximum.&lt;br&gt;
Input: arr[] = [1, 4, 2, 10, 23, 3, 1, 0, 20], k = 4&lt;br&gt;
Output: 39&lt;br&gt;
Explanation: arr1 + arr2 + arr3 + arr4 = 39, which is maximum.&lt;/p&gt;

&lt;p&gt;Input: arr[] = [100, 200, 300, 400], k = 1&lt;br&gt;
Output: 400&lt;br&gt;
Explanation: arr3 = 400, which is maximum.&lt;br&gt;
Constraints:&lt;br&gt;
1 ≤ arr.size() ≤ 106&lt;br&gt;
1 ≤ arr[i] ≤ 106&lt;br&gt;
1 ≤ k ≤ arr.size()&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;br&gt;
class Solution:&lt;br&gt;
    def maxSubarraySum(self, arr, k):&lt;br&gt;
        n = len(arr)&lt;br&gt;
        curr = sum(arr[:k])&lt;br&gt;
        ans = curr&lt;br&gt;
        for i in range(k, n):&lt;br&gt;
            curr += arr[i] - arr[i-k]&lt;br&gt;
            ans = max(ans, curr)&lt;br&gt;
        return ans&lt;/p&gt;

</description>
      <category>algorithms</category>
      <category>coding</category>
      <category>devjournal</category>
    </item>
    <item>
      <title>Day 92 of 100 days dsa coding challenge</title>
      <dc:creator>Manasi Patil</dc:creator>
      <pubDate>Sun, 04 Jan 2026 12:42:21 +0000</pubDate>
      <link>https://forem.com/manasi_patil_/day-92-of-100-days-dsa-coding-challenge-55e9</link>
      <guid>https://forem.com/manasi_patil_/day-92-of-100-days-dsa-coding-challenge-55e9</guid>
      <description>&lt;p&gt;Taking on a new challenge: solving GeeksforGeeks POTD daily and sharing my solutions! 💻🔥&lt;br&gt;
The goal: sharpen problem-solving skills, level up coding, and learn something new every day. Follow my journey! 🚀&lt;/p&gt;

&lt;h1&gt;
  
  
  100DaysOfCode #CodingChallenge #ProblemSolving #GeeksforGeeks #DeveloperJourney
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Problem:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
&lt;a href="https://www.geeksforgeeks.org/problems/sort-an-array-of-0s-1s-and-2s4231/1" rel="noopener noreferrer"&gt;https://www.geeksforgeeks.org/problems/sort-an-array-of-0s-1s-and-2s4231/1&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sort 0s, 1s and 2s&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Difficulty: Medium  Accuracy: 50.58%&lt;/p&gt;

&lt;p&gt;Given an array arr[] containing only 0s, 1s, and 2s. Sort the array in ascending order.&lt;br&gt;
Note: You need to solve this problem without utilizing the built-in sort function.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Examples:&lt;/strong&gt;&lt;br&gt;
Input: arr[] = [0, 1, 2, 0, 1, 2]&lt;br&gt;
Output: [0, 0, 1, 1, 2, 2]&lt;br&gt;
Explanation: 0s, 1s and 2s are segregated into ascending order.&lt;br&gt;
Input: arr[] = [0, 1, 1, 0, 1, 2, 1, 2, 0, 0, 0, 1]&lt;br&gt;
Output: [0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2]&lt;br&gt;
Explanation: 0s, 1s and 2s are segregated into ascending order.&lt;br&gt;
Follow up: Could you come up with a one-pass algorithm using only constant extra space?&lt;br&gt;
Constraints:&lt;br&gt;
1 ≤ arr.size() ≤ 106&lt;br&gt;
0 ≤ arr[i] ≤ 2&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;br&gt;
class Solution:&lt;br&gt;
    def sort012(self, arr):&lt;br&gt;
        low, mid, high = 0, 0, len(arr) - 1&lt;br&gt;
        while mid &amp;lt;= high:&lt;br&gt;
            if arr[mid] == 0:&lt;br&gt;
                arr[low], arr[mid] = arr[mid], arr[low]&lt;br&gt;
                low += 1&lt;br&gt;
                mid += 1&lt;br&gt;
            elif arr[mid] == 1:&lt;br&gt;
                mid += 1&lt;br&gt;
            else:&lt;br&gt;
                arr[high], arr[mid] = arr[mid], arr[high]&lt;br&gt;
                high -= 1&lt;br&gt;
        return arr&lt;/p&gt;

</description>
      <category>algorithms</category>
      <category>devjournal</category>
      <category>interview</category>
    </item>
    <item>
      <title>Day 91 of 100 days dsa coding challenge</title>
      <dc:creator>Manasi Patil</dc:creator>
      <pubDate>Sat, 03 Jan 2026 04:40:54 +0000</pubDate>
      <link>https://forem.com/manasi_patil_/day-91-of-100-days-dsa-coding-challenge-4la9</link>
      <guid>https://forem.com/manasi_patil_/day-91-of-100-days-dsa-coding-challenge-4la9</guid>
      <description>&lt;p&gt;Taking on a new challenge: solving GeeksforGeeks POTD daily and sharing my solutions! 💻🔥&lt;br&gt;
The goal: sharpen problem-solving skills, level up coding, and learn something new every day. Follow my journey! 🚀&lt;/p&gt;

&lt;h1&gt;
  
  
  100DaysOfCode #CodingChallenge #ProblemSolving #GeeksforGeeks #DeveloperJourney
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Problem:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
&lt;a href="https://www.geeksforgeeks.org/problems/flattening-a-linked-list/1" rel="noopener noreferrer"&gt;https://www.geeksforgeeks.org/problems/flattening-a-linked-list/1&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Flattening a Linked List&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Difficulty: Medium  Accuracy: 51.53%&lt;/p&gt;

&lt;p&gt;Given a linked list containing n head nodes where every node in the linked list contains two pointers:&lt;br&gt;
(i) next points to the next node in the list.&lt;br&gt;
(ii) bottom points to a sub-linked list where the current node is the head.&lt;br&gt;
Each of the sub-linked lists nodes and the head nodes are sorted in ascending order based on their data. Flatten the linked list such that all the nodes appear in a single level while maintaining the sorted order.&lt;br&gt;
Note:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;↓ represents the bottom pointer and → represents the next pointer.&lt;/li&gt;
&lt;li&gt;The flattened list will be printed using the bottom pointer instead of the next pointer.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Examples:&lt;/strong&gt;&lt;br&gt;
Input:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F66dfungmgupvr0oc0o9d.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F66dfungmgupvr0oc0o9d.webp" alt=" " width="734" height="396"&gt;&lt;/a&gt;&lt;br&gt;
Output: 5 -&amp;gt; 7 -&amp;gt; 8 -&amp;gt; 10 -&amp;gt; 19 -&amp;gt; 20 -&amp;gt; 22 -&amp;gt; 28 -&amp;gt; 40 -&amp;gt; 45.&lt;br&gt;
Explanation: &lt;br&gt;
Bottom pointer of 5 is pointing to 7.&lt;br&gt;
Bottom pointer of 7 is pointing to 8.&lt;br&gt;
Bottom pointer of 10 is pointing to 20 and so on.&lt;br&gt;
So, after flattening the linked list the sorted list will be &lt;br&gt;
5 -&amp;gt; 7 -&amp;gt; 8 -&amp;gt; 10 -&amp;gt; 19 -&amp;gt; 20 -&amp;gt; 22 -&amp;gt; 28 -&amp;gt; 40 -&amp;gt; 45.&lt;br&gt;
Input:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6d13foqpvqqhiir46bh9.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6d13foqpvqqhiir46bh9.webp" alt=" " width="734" height="334"&gt;&lt;/a&gt;&lt;br&gt;
Output: 5 -&amp;gt; 7 -&amp;gt; 8 -&amp;gt; 10 -&amp;gt; 19 -&amp;gt; 22 -&amp;gt; 28 -&amp;gt; 30 -&amp;gt; 50&lt;br&gt;
Explanation:&lt;br&gt;
Bottom pointer of 5 is pointing to 7.&lt;br&gt;
Bottom pointer of 7 is pointing to 8.&lt;br&gt;
Bottom pointer of 8 is pointing to 30 and so on.&lt;br&gt;
So, after flattening the linked list the sorted list will be &lt;br&gt;
5 -&amp;gt; 7 -&amp;gt; 8 -&amp;gt; 10 -&amp;gt; 19 -&amp;gt; 22 -&amp;gt; 28 -&amp;gt; 30 -&amp;gt; 50.&lt;br&gt;
Constraints:&lt;br&gt;
0 ≤ n ≤ 100&lt;br&gt;
1 ≤ number of nodes in sub-linked list(mi) ≤ 50&lt;br&gt;
1 ≤ node-&amp;gt;data ≤ 104&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;br&gt;
class Solution:&lt;br&gt;
    def merge(self, a, b):&lt;br&gt;
        if not a: &lt;br&gt;
            return b&lt;br&gt;
        if not b: &lt;br&gt;
            return a&lt;br&gt;
        if a.data &amp;lt; b.data:&lt;br&gt;
            result = a&lt;br&gt;
            result.bottom = self.merge(a.bottom, b)&lt;br&gt;
        else:&lt;br&gt;
            result = b&lt;br&gt;
            result.bottom = self.merge(a, b.bottom)&lt;br&gt;
        result.next = None&lt;br&gt;
        return result&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def flatten(self, root):
    if not root or not root.next:
        return root
    root.next = self.flatten(root.next)
    root = self.merge(root, root.next)
    return root
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>algorithms</category>
      <category>devchallenge</category>
      <category>devjournal</category>
      <category>learning</category>
    </item>
    <item>
      <title>Day 90 of 100 days dsa coding challenge</title>
      <dc:creator>Manasi Patil</dc:creator>
      <pubDate>Fri, 02 Jan 2026 03:41:17 +0000</pubDate>
      <link>https://forem.com/manasi_patil_/day-90-of-100-days-dsa-coding-challenge-oll</link>
      <guid>https://forem.com/manasi_patil_/day-90-of-100-days-dsa-coding-challenge-oll</guid>
      <description>&lt;p&gt;Taking on a new challenge: solving GeeksforGeeks POTD daily and sharing my solutions! 💻🔥&lt;br&gt;
The goal: sharpen problem-solving skills, level up coding, and learn something new every day. Follow my journey! 🚀&lt;/p&gt;

&lt;h1&gt;
  
  
  100DaysOfCode #CodingChallenge #ProblemSolving #GeeksforGeeks #DeveloperJourney
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Problem:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
&lt;a href="https://www.geeksforgeeks.org/problems/sort-an-array-of-0s-1s-and-2s4231/1" rel="noopener noreferrer"&gt;https://www.geeksforgeeks.org/problems/sort-an-array-of-0s-1s-and-2s4231/1&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sort 0s, 1s and 2s&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Difficulty: Medium  Accuracy: 50.58%&lt;/p&gt;

&lt;p&gt;Given an array arr[] containing only 0s, 1s, and 2s. Sort the array in ascending order.&lt;br&gt;
Note: You need to solve this problem without utilizing the built-in sort function.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Examples:&lt;/strong&gt;&lt;br&gt;
Input: arr[] = [0, 1, 2, 0, 1, 2]&lt;br&gt;
Output: [0, 0, 1, 1, 2, 2]&lt;br&gt;
Explanation: 0s, 1s and 2s are segregated into ascending order.&lt;br&gt;
Input: arr[] = [0, 1, 1, 0, 1, 2, 1, 2, 0, 0, 0, 1]&lt;br&gt;
Output: [0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2]&lt;br&gt;
Explanation: 0s, 1s and 2s are segregated into ascending order.&lt;br&gt;
Follow up: Could you come up with a one-pass algorithm using only constant extra space?&lt;br&gt;
Constraints:&lt;br&gt;
1 ≤ arr.size() ≤ 106&lt;br&gt;
0 ≤ arr[i] ≤ 2&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;br&gt;
class Solution:&lt;br&gt;
    def sort012(self, arr):&lt;br&gt;
        low, mid, high = 0, 0, len(arr) - 1&lt;br&gt;
        while mid &amp;lt;= high:&lt;br&gt;
            if arr[mid] == 0:&lt;br&gt;
                arr[low], arr[mid] = arr[mid], arr[low]&lt;br&gt;
                low += 1&lt;br&gt;
                mid += 1&lt;br&gt;
            elif arr[mid] == 1:&lt;br&gt;
                mid += 1&lt;br&gt;
            else:&lt;br&gt;
                arr[high], arr[mid] = arr[mid], arr[high]&lt;br&gt;
                high -= 1&lt;br&gt;
        return arr&lt;/p&gt;

</description>
      <category>algorithms</category>
      <category>devchallenge</category>
      <category>devjournal</category>
    </item>
  </channel>
</rss>
