input: from typing import List
  from functools import reduce
  import math
  def minimum_array_length(nums: List[int]) -> int:
      """
      You are given a 0-indexed integer array nums containing positive integers.
  
      Your task is to minimize the length of nums by performing the following operations any number of times (including zero):
  
      Select two distinct indices i and j from nums, such that nums[i] > 0 and nums[j] > 0.
  
      Insert the result of nums[i] % nums[j] at the end of nums.
  
      Delete the elements at indices i and j from nums.
  
      Return an integer denoting the minimum length of nums after performing the operation any number of times.
  
      Examples:
      >>> nums = [1,4,3,1]
      1
      >>> nums = [5,5,5,10,5]
      2
      >>> nums = [2,3,4]
      1
  
      Constraints:
      1 <= nums.length <= 10^5
      1 <= nums[i] <= 10^9
      """
  
output: 
      while len(nums) > 1:
          nums.sort()
          new_element = nums[-1] % nums[-2]
          nums = nums[:-2] + [new_element]
          if new_element == 0:
              break
      return len(nums)
  