input: from typing import List
  
  def count_special_subarrays(nums: List[int]) -> int:
      """
      Given a list of positive integers nums, determine the count of subarrays where the first and last elements are 
      the largest numbers within that subarray.
  
      Parameters:
      nums (List[int]): The input list of positive integers.
  
      Returns:
      int: The count of subarrays meeting the specified condition.
  
      Examples:
      >>> count_special_subarrays([1, 4, 3, 3, 2])
      6
      >>> count_special_subarrays([3, 3, 3])
      6
      >>> count_special_subarrays([1])
      1
      """
output:     n = len(nums)
      count = 0
      for i in range(n):
          max_num = nums[i]
          for j in range(i, n):
              if nums[j] > max_num:
                  break
              if nums[j] == max_num and nums[i] == max_num:
                  count += 1
      return count