public void It_should_return_1_2() { var p = new Prob83(); //var result = p.DeleteDuplicates(new[] //{ // 1,1,2 //}.ToLinkedList()); var result = p.DeleteDuplicates(new ListNode { val = 1, next = new ListNode { val = 1, next = new ListNode { val = 2 } } }); Assert.AreEqual(result, (new ListNode { val = 1, next = new ListNode { val = 2 } })); }
public void It_should_return_1_2_3() { var p = new Prob83(); var result = p.DeleteDuplicates(new[] { 1, 1, 2, 3, 3 }.ToLinkedList()); Assert.AreEqual(result, new[] { 1, 2, 3 }.ToLinkedList()); }