input: from typing import List
  
  def allocate_to_two_arrays(nums: List[int]) -> List[int]:
      """
      You are given an array of unique integers called nums with length n, starting index from 1.
  
      The task is to distribute all the elements of nums between two arrays: arr1 and arr2 in n operations. Initially, append nums[1] to arr1 and nums[2] to arr2. For each subsequent i-th operation:
  
      If the last element of arr1 is larger than the last element of arr2, append nums[i] to arr1. Otherwise, append nums[i] to arr2.
      The resulting array is formed by merging arr1 and arr2. For example, if arr1 == [1,2,3] and arr2 == [4,5,6], the result = [1,2,3,4,5,6].
  
      Return the resulting array.
  
      Examples:
      >>> nums = [2,1,3]
      [2,3,1]
      >>> nums = [5,4,3,8]
      [5,3,4,8]
  
      Constraints:
      3 <= n <= 50
      1 <= nums[i] <= 100
      All elements in nums are unique.
      """
output:     
      if not nums:
          return []
  
      arr1 = [nums[0]]
      arr2 = [nums[1]]
      
      for i in range(2, len(nums)):
          if arr1[-1] > arr2[-1]:
              arr1.append(nums[i])
          else:
              arr2.append(nums[i])
      
      return arr1 + arr2
  