摘要:
public class RemoveAllAdjacentDuplicatesInString { /* 解法一:栈 */ public String removeDuplicates(String S) { Stack<Character> stack=new Stack<>(); for (char c:S.toCharArray()){ if (stack.isEmpty()||c!=st 阅读全文
摘要:
public class RemoveDuplicatesFromSortedList { public ListNode deleteDuplicates(ListNode head) { ListNode current=head; while (current!=null&¤t.next!=null){ if (current.val==current.next.val) cur 阅读全文