Skip to content

Instantly share code, notes, and snippets.

View hodbby's full-sized avatar

Hod hodbby

  • 13:38 (UTC +03:00)
View GitHub Profile
@hodbby
hodbby / gist:1699166
Created January 29, 2012 14:56
My 3 rows solution
def linear_merge(list1, list2):
list1.sort (list1.extend (list2))
return list1
@hodbby
hodbby / gist:1698934
Created January 29, 2012 13:56
Google 10 rows solution
def linear_merge(list1, list2):
result = []
while len(list1) and len(list2):
if list1[0] < list2[0]:
result.append(list1.pop(0))
else:
result.append(list2.pop(0))
result.extend(list1)
result.extend(list2)
@hodbby
hodbby / My solution1
Created January 29, 2012 13:52
My solution
def linear_merge(list1, list2):
list1.sort (list1.extend (list2))
return list1