You are viewing a single comment's thread. Return to all comments →
You need a cast on that first return as well: the problem requires a 1 to be returned, not a True.
Eg in Python 2 or Python 3:
def CompareLists(headA, headB): while headA or headB: if not (headA and headB) or headA.data != headB.data: return 0 headA = headA.next headB = headB.next return 1
Seems like cookies are disabled on this browser, please enable them to open this website
Compare two linked lists
You are viewing a single comment's thread. Return to all comments →
You need a cast on that first return as well: the problem requires a 1 to be returned, not a True.
Eg in Python 2 or Python 3: