I have a linked-list and I want to calculate it's length with a function, here's my definition :
class ListNode(object):
def __init__(self, x):
self.val = x
self.next = None
I have a linked-list and I want to calculate it's length with a function, here's my definition :
class ListNode(object):
def __init__(self, x):
self.val = x
self.next = None