input: from typing import List
  from math import isqrt
  
  def largest_prime_gap(nums: List[int]) -> int:
      """
      Given an array of integers, nums, your task is to compute the largest gap between the positions of any pair of (not necessarily distinct) prime numbers within the array.
  
      Examples:
      >>> nums = [4,2,9,5,3]
      3
      >>> nums = [4,8,2,8]
      0
  
      Constraints:
      1 <= len(nums) <= 3 * 10^5
      1 <= nums[i] <= 100
      The nums array contains at least one prime number.
      """
output:     
  def is_prime(n: int) -> bool:
      if n <= 1:
          return False
      if n == 2 or n == 3:
          return True
      if n % 2 == 0 or n % 3 == 0:
          return False
      i = 5
      while i * i <= n:
          if n % i == 0 or n % (i + 2) == 0:
              return False
          i += 6
      return True
  
      prime_indices = [i for i, num in enumerate(nums) if is_prime(num)]
      
      if len(prime_indices) < 2:
          return 0
      
      return max(prime_indices) - min(prime_indices)
  