
'''simple docstring'''





from __future__ import annotations

from collections.abc import Callable
from typing import Any, Generic, TypeVar

SCREAMING_SNAKE_CASE     =       TypeVar("""T""")






class 							UpperCAmelCase_							(    Generic[T]				):

 '''simple docstring'''







 def __init__(					self		:  Any			,				snake_case__		:  list[T]			,				snake_case__		:  Callable[[T, T], T] ):



   '''simple docstring'''




   UpperCAmelCase__      :					Any | T				       =							None

   UpperCAmelCase__      :					int				       =							len(snake_case__ )
   UpperCAmelCase__      :					list[T]				       =							[any_type for _ in range(self.N )] + arr
   UpperCAmelCase__      :					Optional[Any]				       =							fnc
   self.build()







 def 							UpperCamelCase  (					self		:  Tuple ):



   '''simple docstring'''




   for p in range(self.N - 1			,				0			,				-1 ):
     UpperCAmelCase__      :					Optional[int]				       =							self.fn(self.st[p * 2]			,				self.st[p * 2 + 1] )







 def 							UpperCamelCase  (					self		:  Optional[Any]			,				snake_case__		:  int			,				snake_case__		:  T ):



   '''simple docstring'''




   p += self.N
   UpperCAmelCase__      :					Union[str, Any]				       =							v
   while p > 1:
     UpperCAmelCase__      :					Any				       =							p // 2
     UpperCAmelCase__      :					Union[str, Any]				       =							self.fn(self.st[p * 2]			,				self.st[p * 2 + 1] )







 def 							UpperCamelCase  (					self		:  Any			,				snake_case__		:  int			,				snake_case__		:  int ):  # noqa: E741



   '''simple docstring'''




   UpperCAmelCase__       ,			UpperCAmelCase__      :					Tuple				       =							l + self.N, r + self.N

   UpperCAmelCase__      :					T | None				       =							None
   while l <= r:
     if l % 2 == 1:
       UpperCAmelCase__      :					Dict				       =							self.st[l] if res is None else self.fn(snake_case__			,				self.st[l] )
     if r % 2 == 0:
       UpperCAmelCase__      :					Any				       =							self.st[r] if res is None else self.fn(snake_case__			,				self.st[r] )
     UpperCAmelCase__       ,			UpperCAmelCase__      :					List[Any]				       =							(l + 1) // 2, (r - 1) // 2
   return res


if __name__ == "__main__":
      from functools import reduce

      SCREAMING_SNAKE_CASE     =       [1, 1_0, -2, 9, -3, 8, 4, -7, 5, 6, 1_1, -1_2]

      SCREAMING_SNAKE_CASE     =       {
          0: 7,
          1: 2,
          2: 6,
          3: -1_4,
          4: 5,
          5: 4,
          6: 7,
          7: -1_0,
          8: 9,
          9: 1_0,
          1_0: 1_2,
          1_1: 1,
      }

      SCREAMING_SNAKE_CASE     =       SegmentTree(test_array, min)
      SCREAMING_SNAKE_CASE     =       SegmentTree(test_array, max)
      SCREAMING_SNAKE_CASE     =       SegmentTree(test_array, lambda a, b: a + b)







      def snake_case_     (					):
        for i in range(len(lowercase__		)		):
          for j in range(lowercase__   ,       len(lowercase__		)		):
            UpperCAmelCase__      :					Dict				       =							reduce(lowercase__   ,       test_array[i : j + 1]		)
            UpperCAmelCase__      :					Tuple				       =							reduce(lowercase__   ,       test_array[i : j + 1]		)
            UpperCAmelCase__      :					Optional[int]				       =							reduce(lambda lowercase__   ,       lowercase__		: a + b   ,       test_array[i : j + 1]		)
            assert min_range == min_segment_tree.query(lowercase__   ,       lowercase__		)
            assert max_range == max_segment_tree.query(lowercase__   ,       lowercase__		)
            assert sum_range == sum_segment_tree.query(lowercase__   ,       lowercase__		)

      test_all_segments()

      for index, value in test_updates.items():
            SCREAMING_SNAKE_CASE     =       value
            min_segment_tree.update(index, value)
            max_segment_tree.update(index, value)
            sum_segment_tree.update(index, value)
            test_all_segments()





'''simple docstring'''





def snake_case_     (					lowercase__ = "The quick brown fox jumps over the lazy dog"   ,       ):
  UpperCAmelCase__      :					Dict				       =							set()

  # Replace all the whitespace in our sentence
  UpperCAmelCase__      :					str				       =							input_str.replace(" "   ,       ""		)
  for alpha in input_str:
    if "a" <= alpha.lower() <= "z":
      frequency.add(alpha.lower()		)
  return len(lowercase__		) == 2_6







def snake_case_     (					lowercase__ = "The quick brown fox jumps over the lazy dog"   ,       ):
  UpperCAmelCase__      :					str				       =							[False] * 2_6
  for char in input_str:
    if char.islower():
      UpperCAmelCase__      :					List[Any]				       =							True
    elif char.isupper():
      UpperCAmelCase__      :					List[Any]				       =							True
  return all(lowercase__		)







def snake_case_     (					lowercase__ = "The quick brown fox jumps over the lazy dog"   ,       ):
  return len({char for char in input_str.lower() if char.isalpha()}		) == 2_6







def snake_case_     (					):
  from timeit import timeit

  UpperCAmelCase__      :					Union[str, Any]				       =							"from __main__ import is_pangram, is_pangram_faster, is_pangram_fastest"
  print(timeit("is_pangram()"   ,       setup=lowercase__		)		)
  print(timeit("is_pangram_faster()"   ,       setup=lowercase__		)		)
  print(timeit("is_pangram_fastest()"   ,       setup=lowercase__		)		)
  # 5.348480500048026, 2.6477354579837993, 1.8470395830227062
  # 5.036091582966037, 2.644472333951853,  1.8869528750656173


if __name__ == "__main__":
      import doctest

      doctest.testmod()
      benchmark()



