@@ -0,0 +1,759 @@
+%22%22%22%0ADefinition of ListNode%0Aclass ListNode(object):%0A%0A    def __init__(self, val, next=None):%0A        self.val = val%0A        self.next = next%0A%22%22%22%0Aclass Solution:%0A    %22%22%22%0A    @param head: The first node of linked list.%0A    @param x: an integer%0A    @return: a ListNode%0A    %22%22%22%0A    def partition(self, head, x):%0A        # write your code here%0A        # Solution 1%0A        arr = %5B%5D%0A        tmp = head%0A        while (tmp):%0A            arr.append(tmp.val)%0A            tmp = tmp.next%0A        less = filter(lambda n: n %3C x, arr)%0A        rest = filter(lambda n: n %3E= x, arr)%0A        arr = less + rest%0A        arr = map(lambda n: ListNode(n), arr)%0A        for i in range(len(arr) - 1):%0A            arr%5Bi%5D.next = arr%5Bi + 1%5D%0A        return arr%5B0%5D if len(arr) %3E 0 else None%0A

Add solution to lintcode question 96