Beispiel #1
0
        public void DeleteNodes_1()
        {
            var head = TestHelper.GenerateList(new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 });

            var solution = new _1474_DeleteNNodesAfterMNodesOfALinkedList();
            var result   = solution.DeleteNodes(head, 2, 3);

            AssertHelper.AssertLinkList(new int[] { 1, 2, 6, 7, 11, 12 }, result);
        }
Beispiel #2
0
        public void DeleteNodes_4()
        {
            var head = TestHelper.GenerateList(new int[] { 9, 3, 7, 7, 9, 10, 8, 2 });

            var solution = new _1474_DeleteNNodesAfterMNodesOfALinkedList();
            var result   = solution.DeleteNodes(head, 1, 2);

            AssertHelper.AssertLinkList(new int[] { 9, 7, 8 }, result);
        }