input: Write a python function that takes a list of integers and returns the length of the longest contiguous subarray that is either strictly increasing or strictly decreasing.
  
  from typing import List
  
  def longest_monotonic_subarray(nums: List[int]) -> int:
      """
      Given a list of integers, determine the length of the longest subarray that is either strictly increasing or strictly decreasing.
  
      Examples:
      >>> nums = [1,4,3,3,2]
      2
  
      >>> nums = [3,3,3,3]
      1
  
      >>> nums = [3,2,1]
      3
  
      Constraints:
      1 <= len(nums) <= 50
      1 <= nums[i] <= 50
      """
output: def longest_monotonic_subarray(nums: List[int]) -> int:
      if not nums:
          return 0
  
      max_len = 1
      inc_len = 1
      dec_len = 1
      
      for i in range(1, len(nums)):
          if nums[i] > nums[i - 1]:
              inc_len += 1
              dec_len = 1
          elif nums[i] < nums[i - 1]:
              dec_len += 1
              inc_len = 1
          else:
              inc_len = 1
              dec_len = 1
          max_len = max(max_len, inc_len, dec_len)
      
      return max_len