/**
 *  * Definition for singly-linked list.
 *   * public class ListNode {
 *    *     int val;
 *     *     ListNode next;
 *      *     ListNode(int x) { val = x; }
 *       * }
 *        */

public class Solution {
    public ListNode partition(ListNode head, int x) {
        ListNode a = new ListNode(0), b = new ListNode(0), tmpA = a, tmpB = b;
        while (head != null) {
            if (head.val < x) {
                tmpA.next = head;
                tmpA = tmpA.next;
            } else {
                tmpB.next = head;
                tmpB = tmpB.next;
            }
            head = head.next;
        }
        tmpB.next = null;
        tmpA.next = b.next;
        return a.next;
    }
}

@@ -1,17 +1,14 @@
 /**%0A *
-  *
  Definit
@@ -37,20 +37,16 @@
 list.%0A *
-   *
  public 
@@ -65,25 +65,20 @@
 de %7B%0A * 
-   *
     
- 
 int val;
@@ -80,22 +80,16 @@
  val;%0A *
-     *
      Lis
@@ -102,23 +102,16 @@
 next;%0A *
-      *
      Lis
@@ -143,27 +143,10 @@
 %0A * 
-      * %7D%0A *       
+%7D%0A
  */%0A

fix code