import { ListNode } from './LinkList' ; param { ListNode } head param { number } x function SeparateList ( head , x ) { let before_x = new ListNode ( 0 , null ) ; let after_x = new ListNode ( 0 , null ) ; let before_head = before_x ; let after_head = after_x ; while ( head ) { if ( head . val < x ) { before_x . next = head ; before_x = before_x . next ; } else { after_x . next = head ; after_x = after_x . next ; } head = head . next ; } after_x . next = null ; before_x . next = after_head . next ; return before_head . next ; } export default SeparateList ;