题目
法1:快慢指针
class Solution {public ListNode deleteDuplicates(ListNode head) {if (head == null || head.next == null) {return head;}ListNode slow = head, fast = head.next;while (fast != null) {if (fast.val > slow.val) {slow.next = fast;slow = slow.next;}fast = fast.next;}slow.next = null;return head;}
}