//C#
ListNode s = head;
while (s!=null&&s.next!=null)
{
if(s.val == s.next.val) s.next = s.next.next;
else s = s.next;
}
return head;
#Python 3
s = head
while s and s.next:
if s.val == s.next.val:s.next = s.next.next
else:s = s.next
return head