<?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>DEV Community: Jayesh Adwani</title>
    <description>The latest articles on DEV Community by Jayesh Adwani (@jayesh_adwani_de96b24de62).</description>
    <link>https://dev.to/jayesh_adwani_de96b24de62</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%2F1780126%2F8cd3dad5-1249-48fa-853d-103d3159e398.jpg</url>
      <title>DEV Community: Jayesh Adwani</title>
      <link>https://dev.to/jayesh_adwani_de96b24de62</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jayesh_adwani_de96b24de62"/>
    <language>en</language>
    <item>
      <title>Find all unique triplets that sum upto 0</title>
      <dc:creator>Jayesh Adwani</dc:creator>
      <pubDate>Wed, 20 Aug 2025 04:03:04 +0000</pubDate>
      <link>https://dev.to/jayesh_adwani_de96b24de62/find-all-unique-triplets-that-sum-upto-0-41af</link>
      <guid>https://dev.to/jayesh_adwani_de96b24de62/find-all-unique-triplets-that-sum-upto-0-41af</guid>
      <description>&lt;p&gt;Initially I struggled to find the right approach to the problem. I used 3 pointers thought it would save the performance cases. But I was wrong there, this is a two pointer problem after sorting.&lt;/p&gt;

&lt;p&gt;Approach: for an index i, take j and k such that, arr[i] + arr[j] +arr[k] equals 0. &lt;br&gt;
If sum &amp;lt; 0, j++, &lt;br&gt;
If sum &amp;gt; 0, k--,&lt;br&gt;
If sum = 0, j++, k--,&lt;/p&gt;

&lt;p&gt;Handle duplicates for i,j,k by comparing current to next index elements&lt;/p&gt;

&lt;p&gt;Try all combinations using while loop inside a for loop&lt;/p&gt;

&lt;p&gt;Time Complexity: O(nlogn) + O(n*m) where m is elements from next to last element.&lt;/p&gt;

&lt;p&gt;Space Complexity: O(n)&lt;/p&gt;

</description>
      <category>dsa</category>
      <category>cpp</category>
      <category>100daysofcode</category>
    </item>
    <item>
      <title>[Boost]</title>
      <dc:creator>Jayesh Adwani</dc:creator>
      <pubDate>Wed, 20 Aug 2025 03:52:46 +0000</pubDate>
      <link>https://dev.to/jayesh_adwani_de96b24de62/-gl1</link>
      <guid>https://dev.to/jayesh_adwani_de96b24de62/-gl1</guid>
      <description></description>
      <category>discuss</category>
    </item>
    <item>
      <title>Move all the zeros to the right of the array.</title>
      <dc:creator>Jayesh Adwani</dc:creator>
      <pubDate>Mon, 18 Aug 2025 19:20:00 +0000</pubDate>
      <link>https://dev.to/jayesh_adwani_de96b24de62/move-all-the-zeros-to-the-right-of-the-array-5h0l</link>
      <guid>https://dev.to/jayesh_adwani_de96b24de62/move-all-the-zeros-to-the-right-of-the-array-5h0l</guid>
      <description>&lt;p&gt;Array contains 0 and positive numbers.&lt;/p&gt;

&lt;p&gt;Approach 1: Brute force, iterate over array if element is 0, find the next non-zero element to swap, using while loop.&lt;/p&gt;

&lt;p&gt;Good, solves the issue but failed performance test cases. As nested loops are used.&lt;/p&gt;

&lt;p&gt;Time Complexity: O(n*m), where m is number of elements to the right of current element.&lt;br&gt;
Space Complexity: O(1), no memory resource utilized.&lt;/p&gt;

&lt;p&gt;Approach 2; To obtain result in single loop, create a new array vector the first push the non-zero elements then remaining zeros.&lt;/p&gt;

&lt;p&gt;Passed all the test cases&lt;/p&gt;

&lt;p&gt;Time Complexity: O(n)&lt;br&gt;
Space Complexity: O(n)&lt;/p&gt;

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

</description>
      <category>dsa</category>
      <category>cpp</category>
      <category>100daysofcode</category>
    </item>
  </channel>
</rss>
