input: Write a function to merge two sorted arrays into a single sorted array.
  assert merge_arrays([1, 3, 5], [2, 4, 6]) == [1, 2, 3, 4, 5, 6]
  assert merge_arrays([1, 2, 3], [4, 5, 6]) == [1, 2, 3, 4, 5, 6]
  assert merge_arrays([5, 10, 15], [3, 8, 9]) == [3, 5, 8, 9, 10, 15]
  assert merge_arrays([], [1, 2, 3]) == [1, 2, 3]
  assert merge_arrays([1, 2, 3], []) == [1, 2, 3]
output: def merge_arrays(arr1, arr2):
      merged_array = []
      i, j = 0, 0
      
      while i < arr1.length and j < arr2.length:
          if arr1[i] <= arr2[j]:
              merged_array.append(arr1[i])
              i += 1
          else:
              merged_array.append(arr2[j])
              j += 1
      
      while i < arr1.length:
          merged_array.append(arr1[i])
          i += 1
      
      while j < arr2.length:
          merged_array.append(arr2[j])
          j += 1
      
      return merged_array