示例#1
0
def test(head_list, n, ans_list):

    head = ListNode.fromList(head_list)
    ans = ListNode.fromList(ans_list)

    s = Solution()
    r = s.removeNthFromEnd(head, n)
    if r != ans:
        print('not correct', head_list, n, r, ans)
示例#2
0
文件: main.py 项目: hasadent/leetcode
def test(head_list, k, ans_list):

    head = ListNode.fromList(head_list)
    ans = ListNode.fromList(ans_list)

    s = Solution()
    r = s.reverseKGroup(head, k)
    if r != ans:
        print('not correct', head_list, k, r, ans)
示例#3
0
def test(head_list, ans_list):

    head = ListNode.fromList(head_list)
    ans = ListNode.fromList(ans_list)

    s = Solution()
    r = s.swapPairs(head)
    if r != ans:
        print('not correct', head_list, r, ans)