title: How to convert the given Before Links to the After Links using a couple of lines of code in Java?
body: <pre><code>Before:
         +----+----+
  list--&gt;|  1 |  / |
         +----+----+
         +----+----+    +----+----+    +----+----+
  list2-&gt; |  2 |  +----&gt; |  3 |  +----&gt; |  4 |  / |
         +----+----+    +----+----+    +----+----+
  After:
             +----+----+      +----+----+    +----+----+
  list 1----&gt;| 4 |     +----&gt; |  1 |  +----&gt; |  2 |  / |
             +----+----+      +----+----+    +----+----+
  
            +----+----+ 
  List2----&gt;|  3 |  / |
            +----+----+ 
  </code></pre>
  
  <p>This is what I have :</p>
  
  <pre><code>list.next = list2.next.next // 4 -&gt; 1
  list = list2 // 4 -&gt; 1 -&gt; 4 -&gt; 2 -&gt; 3 -&gt; 4
  list2 = list.next.next.next.next // 3
  list.next.next.next.next = null // 4 -&gt; 1 -&gt; 4 -&gt; 2
  </code></pre>
  
  <p>I don't know if it is right? I am having trouble figuring out the problem</p>