fixed code
public java v1 · immutable public static IntNode common(IntNode head1, IntNode head2) { if(head1==null) return head1; if(head2==null) return head2; IntNode s = new IntNode(); if(head1.data>head2.data){ common(head1, head2.next); }else if (head1.data<head2.data){ common(head1.next, head2); }else{ s = head1; s.next = common(head1.next, head2.next); } return s; }