input: from typing import List
  from functools import reduce
  import math
  def reduce_array_length(nums: List[int]) -> int:
      """
      Given a 0-indexed array of positive integers nums.
  
      The objective is to reduce the length of nums by conducting the following operations any number of times (including zero):
  
      Choose two distinct indexes i and j from nums, such that nums[i] > 0 and nums[j] > 0.
  
      Append the result of nums[i] % nums[j] to nums.
  
      Remove the elements at indices i and j from nums.
  
      Return an integer representing the minimum length of nums after performing the operations 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(reverse=True)  # Sort the numbers in descending order.
          num1 = nums.pop(0)       # Get the largest number.
          num2 = nums.pop(0)       # Get the second largest number.
          remainder = num1 % num2  # Calculate the remainder.
          if remainder > 0:        # If there's a non-zero remainder, add it back to the list.
              nums.append(remainder)
  
      return len(nums)
  