<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Rohit Saini on Medium]]></title>
        <description><![CDATA[Stories by Rohit Saini on Medium]]></description>
        <link>https://medium.com/@Rohit08?source=rss-80a673196209------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*u_pJNWDWQV7vduboEVEyww.jpeg</url>
            <title>Stories by Rohit Saini on Medium</title>
            <link>https://medium.com/@Rohit08?source=rss-80a673196209------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 13:16:34 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@Rohit08/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Leetcode 75: Sort Colors]]></title>
            <link>https://medium.com/@Rohit08/leetcode-75-sort-colors-e2216fc39c6d?source=rss-80a673196209------2</link>
            <guid isPermaLink="false">https://medium.com/p/e2216fc39c6d</guid>
            <category><![CDATA[data-structures]]></category>
            <category><![CDATA[sorting-algorithms]]></category>
            <category><![CDATA[neetcode-150]]></category>
            <category><![CDATA[leetcode]]></category>
            <dc:creator><![CDATA[Rohit Saini]]></dc:creator>
            <pubDate>Thu, 20 Aug 2026 18:42:30 GMT</pubDate>
            <atom:updated>2026-08-20T18:44:06.096Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MlbpbydJ1hI6s4s-AGzWNA.jpeg" /><figcaption>Dutch National Flag</figcaption></figure><p>You are given an array nums with some N number of objects which are colored red, white or blue. Your task is to sort the array (in-place) such that same color objects are adjacent and with the colors in the order Red, White, Blue.</p><p>Here Red, Blue and White are represented by integers 0, 1, and 2 respectively. Your task is to solve the problem in Linear Time and without using any in-built library sort function.</p><h3>Naive Approach</h3><p>Although it is mentioned that we have to solve the question in linear time complexity O(N), but if you encountered this question in an Online Assessment and you can’t really figure out the DNFS Algorithm, the you can just simply use Quick Sort or Merge Sort, that will take O(NlogN) time complexity.</p><h3>Better Approach</h3><p>Counting Sort, since there are only 3 unique number of elements that are there in the array, we can just simply keep track of the frequencies of each of the unique element and then just re-iterate over the array again to replace the values according to the frequencies of 0s, 1s, and 2s. This approach will take linear time complexity O(2N), but still we are using two for loops, first to count the frequencies and the second to replace the elements according to the frequencies.</p><pre>void sortColors (vector&lt;int&gt;&amp; nums) {<br>  // Time Complexity: O(2N)<br>  // Space Complexity: O(1)<br>  <br>  int zeroes = 0;<br>  int ones = 0;<br>  int twos = 0;<br>  <br>  for (int value : nums) {<br>    if (value == 0) zeroes++;<br>    else if (value == 1) ones++;<br>    else twos++;<br>  }<br>  <br>  int n = nums.size();<br>  for (int i = 0; i&lt;n; i++) {<br>    if (zeroes) {<br>      nums[i] = 0;<br>      zeroes--;<br>    }<br>    else if (ones) {<br>      nums[i] = 1;<br>      ones--;<br>    }<br>    else {<br>      nums[i] = 2;<br>      twos--;<br>    }<br>  }<br>}</pre><h3>Optimal Approach</h3><p>Well, you might have noticed the flag above, that is the Dutch’s National Flag, and the algorithm that we will be using to solve this question optimally is name after the flag, it is <strong>Dutch National Flag Sorting Algorithm. </strong>It was created by the renowned scientist<strong> Edsger W. Dijkstra</strong> in 1976.</p><p>To implement this algorithm, we will be needing three pointers: low, medium and high pointing at 0, 0, and n — 1 respectively.</p><h4>The idea is pretty simple, you just have to follow the below steps on each iteration:</h4><ol><li>All 0s lies from [0, low — 1] index both inclusive</li><li>All 1s lies from [low, mid — 1] index both inclusive</li><li>All 2s lies from [high + 1, n — 1] index both inclusive</li><li>Rest all the undiscovered elements lies from [mid, high]</li></ol><h4>Operations that you need to perform depending on the value at the mid pointer:</h4><ol><li>If value is 0, swap value of low with mid and move both low and mid by one place.</li><li>If value is 1, don’t move low, just move mid one place ahead</li><li>If value is 2, swap value of high and mid, and move <strong>ONLY </strong>high one place back.</li></ol><pre>void sortColors(vector&lt;int&gt;&amp; nums) {<br>  // Dutch National Flag Sorting Algorithm<br>  // Time complexity: O(N)<br>  // Space complexity: O(1)<br>        <br>  int n = nums.size();<br>  int low = 0;<br>  int mid = 0;<br>  int high = n - 1;<br><br>  while (mid &lt;= high) {<br>    if (nums[mid] == 1) mid++;<br>    else if (nums[mid] == 0) {<br>      swap(nums[low], nums[mid]);<br>      low++;<br>      mid++;<br>     }<br>    else {<br>      swap(nums[mid], nums[high]);<br>      high--;<br>    }<br>  }   <br>}</pre><p>Note that we are going till the mid and high are ( ≤ )to each other, but why not ( &lt; ) only, since unprocessed values lies from mid to high (both inclusive) that’s why we are running the loop till ( ≤ ) in order to process every single unprocessed element from mid to high.</p><p>I hope whatever characters I dumped here made sense and if it did then make sure to like the story. Also if you find any syntax error or any other error in general please feel free to reach out.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e2216fc39c6d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Here’s how I am creating a single project that will easily land me a job]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@Rohit08/heres-how-i-am-creating-a-single-project-that-will-easily-land-me-a-job-521e8a29216d?source=rss-80a673196209------2"><img src="https://cdn-images-1.medium.com/max/2600/1*tBGu0qjClfKYnqup3zxnKA.png" width="6048"></a></p><p class="medium-feed-snippet">Yes, this one single project is all you need; implement your own Neural Network from scratch.</p><p class="medium-feed-link"><a href="https://medium.com/@Rohit08/heres-how-i-am-creating-a-single-project-that-will-easily-land-me-a-job-521e8a29216d?source=rss-80a673196209------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@Rohit08/heres-how-i-am-creating-a-single-project-that-will-easily-land-me-a-job-521e8a29216d?source=rss-80a673196209------2</link>
            <guid isPermaLink="false">https://medium.com/p/521e8a29216d</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[html5-canvas]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[game-development]]></category>
            <category><![CDATA[figma]]></category>
            <dc:creator><![CDATA[Rohit Saini]]></dc:creator>
            <pubDate>Mon, 29 Sep 2025 17:18:43 GMT</pubDate>
            <atom:updated>2025-09-30T06:21:52.048Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Handling Asynchronous Operations in Redux]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://javascript.plainenglish.io/handling-asynchronous-operations-in-redux-950e7ca10934?source=rss-80a673196209------2"><img src="https://cdn-images-1.medium.com/max/2600/1*-FnGzZQqRkFPtOkqR48wwg.jpeg" width="4928"></a></p><p class="medium-feed-snippet">Not a member? Happy coding &#x1F5A5;&#xFE0F;</p><p class="medium-feed-link"><a href="https://javascript.plainenglish.io/handling-asynchronous-operations-in-redux-950e7ca10934?source=rss-80a673196209------2">Continue reading on JavaScript in Plain English »</a></p></div>]]></description>
            <link>https://javascript.plainenglish.io/handling-asynchronous-operations-in-redux-950e7ca10934?source=rss-80a673196209------2</link>
            <guid isPermaLink="false">https://medium.com/p/950e7ca10934</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[redux]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Rohit Saini]]></dc:creator>
            <pubDate>Sat, 30 Aug 2025 01:12:13 GMT</pubDate>
            <atom:updated>2025-08-30T01:12:13.024Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[How One Small Bug Took Us Almost a Century Back in Time]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@Rohit08/how-one-small-bug-took-us-almost-a-century-back-in-time-10232defa228?source=rss-80a673196209------2"><img src="https://cdn-images-1.medium.com/max/2600/1*gTXfsssx_IuUW3MNO3fwYw.jpeg" width="4608"></a></p><p class="medium-feed-snippet">Yes, you read that right. We almost went 100 years back in time just because of one single bug, sounds impossible, right?</p><p class="medium-feed-link"><a href="https://medium.com/@Rohit08/how-one-small-bug-took-us-almost-a-century-back-in-time-10232defa228?source=rss-80a673196209------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@Rohit08/how-one-small-bug-took-us-almost-a-century-back-in-time-10232defa228?source=rss-80a673196209------2</link>
            <guid isPermaLink="false">https://medium.com/p/10232defa228</guid>
            <category><![CDATA[loss]]></category>
            <category><![CDATA[global-panic]]></category>
            <category><![CDATA[programmer]]></category>
            <category><![CDATA[computer-bugs]]></category>
            <category><![CDATA[computers]]></category>
            <dc:creator><![CDATA[Rohit Saini]]></dc:creator>
            <pubDate>Tue, 12 Aug 2025 12:51:47 GMT</pubDate>
            <atom:updated>2025-08-12T19:46:50.775Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[How to add a Custom Bottom Tabs Navigation Bar in React Native]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@Rohit08/how-to-add-a-custom-bottom-tabs-navigation-bar-in-react-native-a2959e153066?source=rss-80a673196209------2"><img src="https://cdn-images-1.medium.com/max/2600/1*-QPirh9zciRig-onT1oQzw.png" width="3680"></a></p><p class="medium-feed-snippet">After reading the whole article you will be able to create this beautiful looking bottom tabs navigation in React Native using the Expo&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@Rohit08/how-to-add-a-custom-bottom-tabs-navigation-bar-in-react-native-a2959e153066?source=rss-80a673196209------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@Rohit08/how-to-add-a-custom-bottom-tabs-navigation-bar-in-react-native-a2959e153066?source=rss-80a673196209------2</link>
            <guid isPermaLink="false">https://medium.com/p/a2959e153066</guid>
            <category><![CDATA[expo]]></category>
            <category><![CDATA[figma]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[tabs]]></category>
            <category><![CDATA[navigation]]></category>
            <dc:creator><![CDATA[Rohit Saini]]></dc:creator>
            <pubDate>Fri, 08 Aug 2025 19:12:38 GMT</pubDate>
            <atom:updated>2025-08-09T07:51:24.164Z</atom:updated>
        </item>
    </channel>
</rss>