
"""simple docstring"""






def 					UpperCamelCase		( UpperCAmelCase			)		->bool:

   """simple docstring"""



   return credit_card_number.startswith(("34", "35", "37", "4", "5", "6")			)
def 					UpperCamelCase		( UpperCAmelCase			)		->bool:

   """simple docstring"""



   a_							=			credit_card_number
   a_							=			0
   a_							=			len(__lowercase			) - 2
   for i in range(__lowercase      ,					-1      ,					-2			):
      #  double the value of every second digit
      a_							=			int(cc_number[i]			)
      digit *= 2
      # If doubling of a number results in a two digit number
      # i.e greater than 9(e.g., 6 × 2 = 12),
      # then add the digits of the product (e.g., 12: 1 + 2 = 3, 15: 1 + 5 = 6),
      # to get a single digit number.
      if digit > 9:
         digit %= 10
         digit += 1
      a_							=			cc_number[:i] + str(__lowercase			) + cc_number[i + 1 :]
      total += digit

   # Sum up the remaining digits
   for i in range(len(__lowercase			) - 1      ,					-1      ,					-2			):
      total += int(cc_number[i]			)

   return total % 10 == 0
def 					UpperCamelCase		( UpperCAmelCase			)		->bool:

   """simple docstring"""



   a_							=			F'''{credit_card_number} is an invalid credit card number because'''
   if not credit_card_number.isdigit():
      print(F'''{error_message} it has nonnumerical characters.'''			)
      return False

   if not 13 <= len(__lowercase			) <= 16:
      print(F'''{error_message} of its length.'''			)
      return False

   if not validate_initial_digits(__lowercase			):
      print(F'''{error_message} of its first two digits.'''			)
      return False

   if not luhn_validation(__lowercase			):
      print(F'''{error_message} it fails the Luhn check.'''			)
      return False

   print(F'''{credit_card_number} is a valid credit card number.'''			)
   return True


if __name__ == "__main__":
      import doctest

      doctest.testmod()
      validate_credit_card_number('4111111111111111')
      validate_credit_card_number('32323')

from __future__ import annotations

import time
from collections.abc import Sequence
from random import randint

from matplotlib import pyplot as plt






def        a_		(       __lowercase   :	Sequence[float]       ,					__lowercase   :	int       ,					__lowercase   :	int ) ->  tuple[int | None, int | None, float]:
			if not arr:
						return None, None, 0
			if low == high:
						return low, high, arr[low]

			_snake_case		=			(low + high) // 2
			_snake_case	,					_snake_case	,					_snake_case		=			max_subarray(__lowercase       ,					__lowercase       ,					__lowercase )
			_snake_case	,					_snake_case	,					_snake_case		=			max_subarray(__lowercase       ,					mid + 1       ,					__lowercase )
			_snake_case	,					_snake_case	,					_snake_case		=			max_cross_sum(__lowercase       ,					__lowercase       ,					__lowercase       ,					__lowercase )
			if left_sum >= right_sum and left_sum >= cross_sum:
						return left_low, left_high, left_sum
			elif right_sum >= left_sum and right_sum >= cross_sum:
						return right_low, right_high, right_sum
			return cross_left, cross_right, cross_sum






def        a_		(       __lowercase   :	Sequence[float]       ,					__lowercase   :	int       ,					__lowercase   :	int       ,					__lowercase   :	int ) ->  tuple[int, int, float]:
			_snake_case	,					_snake_case		=			float('-inf' ), -1
			_snake_case	,					_snake_case		=			float('-inf' ), -1

			_snake_case		=			0
			for i in range(__lowercase       ,					low - 1       ,					-1 ):
						summ += arr[i]
						if summ > left_sum:
									_snake_case		=			summ
									_snake_case		=			i

			_snake_case		=			0
			for i in range(mid + 1       ,					high + 1 ):
						summ += arr[i]
						if summ > right_sum:
									_snake_case		=			summ
									_snake_case		=			i

			return max_left, max_right, (left_sum + right_sum)






def        a_		(       __lowercase   :	int ) ->  float:
			_snake_case		=			[randint(1       ,					__lowercase ) for _ in range(__lowercase )]
			_snake_case		=			time.time()
			max_subarray(__lowercase       ,					0       ,					input_size - 1 )
			_snake_case		=			time.time()
			return end - start






def        a_		(       ) ->  None:
			_snake_case		=			[10, 100, 1_000, 10_000, 50_000, 100_000, 200_000, 300_000, 400_000, 500_000]
			_snake_case		=			[time_max_subarray(__lowercase ) for input_size in input_sizes]
			print('No of Inputs\t\tTime Taken' )
			for input_size, runtime in zip(__lowercase       ,					__lowercase ):
						print(__lowercase       ,					'\t\t'       ,					__lowercase )
			plt.plot(__lowercase       ,					__lowercase )
			plt.xlabel('Number of Inputs' )
			plt.ylabel('Time taken in seconds' )
			plt.show()


if __name__ == "__main__":
			from doctest import testmod

			testmod()