You are viewing a single comment's thread. Return to all comments →
Using the dictionaries in python. One of the easiest and time efficient ways
def findMergeNode(head1, head2): temp1 = head1 temp2 = head2 check_dict = {} while temp1!=None: check_dict[temp1]= True temp1 = temp1.next while temp2!=None: if check_dict.get(temp2)==True: return temp2.data temp2 = temp2.next return None
Seems like cookies are disabled on this browser, please enable them to open this website
Find Merge Point of Two Lists
You are viewing a single comment's thread. Return to all comments →
Using the dictionaries in python. One of the easiest and time efficient ways