<?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: Reaper</title>
    <description>The latest articles on DEV Community by Reaper (@reaperggs).</description>
    <link>https://dev.to/reaperggs</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%2F3319928%2F7dd36a3d-156c-4161-a6d5-78053a36a16d.gif</url>
      <title>DEV Community: Reaper</title>
      <link>https://dev.to/reaperggs</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/reaperggs"/>
    <language>en</language>
    <item>
      <title>Linked List Cycle-II #142</title>
      <dc:creator>Reaper</dc:creator>
      <pubDate>Thu, 03 Jul 2025 17:53:38 +0000</pubDate>
      <link>https://dev.to/reaperggs/linked-list-cycle-ii-142-24i5</link>
      <guid>https://dev.to/reaperggs/linked-list-cycle-ii-142-24i5</guid>
      <description>&lt;p&gt;So basically use slow and fast pointers to detect cycle if slow pointer and fast pointer meet each other it means there's a cycle.&lt;/p&gt;

&lt;p&gt;and after that to determine the starting of the cycle, just start a pointer from the head and move it until its not equal to the slow pointer, ps: move both slow and start pointer altogether until they meet&lt;/p&gt;

&lt;p&gt;when they meet return either of them!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Odd-Even Linked List solution #leetcode328</title>
      <dc:creator>Reaper</dc:creator>
      <pubDate>Thu, 03 Jul 2025 15:19:22 +0000</pubDate>
      <link>https://dev.to/reaperggs/odd-even-linked-list-solution-leetcode328-o4k</link>
      <guid>https://dev.to/reaperggs/odd-even-linked-list-solution-leetcode328-o4k</guid>
      <description>&lt;p&gt;Intuition: Make two dummy nodes OddHead and EvenHead, all the odd indices goes to OddHead, and even indices go to EvenHead.&lt;/p&gt;

&lt;p&gt;Approach:&lt;br&gt;
OddHead will have all the odd ones, EvenHead will have all the even ones&lt;br&gt;
connect them via a pointer.&lt;/p&gt;

&lt;p&gt;Java Solution:-&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public ListNode oddEvenList(ListNode head){
    if(head == null || head.next == null) return head;
    ListNode oddHead = new ListNode(-1);
    ListNode evenHead = new ListNode(-1);
    ListNode oddptr = oddHead;
    ListNode evenptr = evenHead;
    ListNode current = head;
    int index = 1;
    while(current!= null){
       if(index%2 == 1){
         oddptr.next = current;
         oddptr = oddptr.next;
        }
        else{
          evenptr.next = current;
          evenptr = evenptr.next;
        }
        current = current.next;
        index++;
     }
     evenptr.next = null;
     oddptr.next = evenHead.next;
     return oddHead.next;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>leetcode</category>
    </item>
  </channel>
</rss>
