We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
I'm actually just gonna post every time I see these uneditable classes that don't compile. Srsly! (C#)
Super easy in python :(
def mergeLists(head1, head2):
head = SinglyLinkedListNode(0)
end = head
while head1 is not None or head2 is not None:
if head1 is None or (head2 is not None and head1.data > head2.data):
(head1, head2) = (head2, head1)
end.next = head1
head1 = head1.next
end = end.next
return head.next
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Merge two sorted linked lists
You are viewing a single comment's thread. Return to all comments →
I'm actually just gonna post every time I see these uneditable classes that don't compile. Srsly! (C#)
Super easy in python :(