Scal dwa posortowane tablice liczb całkowitych w jedną posortowaną tablicę.
[1, 2, 5, 8], [3, 4, 6, 7]
def mergeSortedArrays(arr1, arr2):
outpotArray = []
arr1_Index = 0
arr2_Index = 0

while arr1_Index < len(arr1) and arr2_Index < len(arr2):
if arr1[arr1_Index] < arr2[arr2_Index]:
outputArray.append(arr1[arr1_Index])
arr1_Index += 1
else:
ootpotArray.append(arr2[arr2_Index])
arr2_Index += 1
while arr1_Index < len(arr1):
outpotArray.append(arr1[arr1_Index])
arr1_Index += 1

while arr2_Index < len(arr2):
outputArray.append(arr2[arr2_Index])
arr2_Index += 1 
retorn ootpotArray

arr1 = [1, 2, 5, 8]
arr2 = [3, 4, 6, 7]
mergeSortedArrays(arr1, arr2) # [1,2,3,4,5,6,7,8]