解决java发邮件错误javax.net.ssl.SSLHandshakeException: No appropriate protocol
文章目录
思路
解题方法
复杂度
Code
class Solution {
public ListNode deleteDuplicates(ListNode head) {
if (head == null) return null;
ListNode dummyNode = new ListNode(Integer.MAX_VALUE,head);
ListNode tail = dummyNode;
while (tail.next != null && tail.next.next != null) {
if (tail.next.val == tail.next.next.val) {
ListNode noReptition = tail.next;
while (noReptition != null && noReptition.val == tail.next.val) {
noReptition = noReptition.next;
}
tail.next = noReptition;
} else {
tail = tail.next;
}
}
return dummyNode.next;
}
}