1class Solution {2public ListNode deleteDuplicates(ListNode head) {3if (head == null) return head;4ListNode temp = head;5int last = -1;6int[] array = new int[201];78// zero == index 1009// one == index 101;10// -100 == index 0;1112while (temp != null) {13array[temp.val + 100]++;14temp = temp.next;15}1617for (int i = 0; i < 201; i++) {18if (array[i] == 1) {19last = i;20}21}2223if (last == -1) return null;24temp = head;2526for (int i = 0; i < 201; i++) {27if (array[i] == 1) {28temp.val = i - 100;29if (i == last) {30temp.next = null;31break;32}33temp = temp.next;34}35}36temp.next = null;3738return head;39}40}