input: def count_n_digit_numbers_with_one(n):
      """
      Given a positive integer n, return the count of the numbers of n-digit
      positive integers that either begin or finish with the digit 1.
      """
output:     
      if n == 1:
          return 1  # 1-digit numbers with 1 are just 1 itself
  
      # Calculate the number of n-digit numbers
      total_n_digit_numbers = 9 * 10 ** (n - 1)
  
      # Calculate the numbers that start with 1: 1xx...x (n-1 digits after 1)
      numbers_start_with_1 = 10 ** (n - 1)
  
      # Calculate the numbers that end with 1: xx...x1 (n-1 digits before 1)
      # Numbers ending with 1 excluding those starting with 1 to avoid double count
      numbers_end_with_1 = 10 ** (n - 1) - 10 ** (n - 2)
  
      # Total numbers either starting or ending with 1
      return numbers_start_with_1 + numbers_end_with_1
  