Given a sorted linked list, delete all duplicates such that each element appear only once.
For example,
Given 1->1->2, return 1->2.
Given 1->1->2->3->3, return 1->2->3.
public ListNode deleteDuplicates(ListNode head) {
if (head == null)
return head;
ListNode p1 = head;
while (p1.next != null) {
if (p1.val == p1.next.val) {
p1.<