





def       UpperCamelCase__(			)->list[list[int]]:
       return [list(range(10_00 - i					,	-10_00 - i					,	-1    )    ) for i in range(10_00    )]


a__: Optional[int]							   =						generate_large_matrix()
a__: Any							   =						(
    [[4, 3, 2, -1], [3, 2, 1, -1], [1, 1, -1, -2], [-1, -1, -2, -3]],
    [[3, 2], [1, 0]],
    [[7, 7, 6]],
    [[7, 7, 6], [-1, -2, -3]],
    grid,
)


def       UpperCamelCase__(			UpperCamelCase__     :			list[list[int]]    )->None:
       assert all(row == sorted(UpperCamelCase__					,	reverse=UpperCamelCase__    ) for row in grid    )
       assert all(list(UpperCamelCase__    ) == sorted(UpperCamelCase__					,	reverse=UpperCamelCase__    ) for col in zip(*UpperCamelCase__    )    )


def       UpperCamelCase__(			UpperCamelCase__     :			list[int]    )->int:
       A__		   =		0
       A__		   =		len(UpperCamelCase__    ) - 1

       # Edge cases such as no values or all numbers are negative.
       if not array or array[0] < 0:
              return 0

       while right + 1 > left:
              A__		   =		(left + right) // 2
              A__		   =		array[mid]

              # Num must be negative and the index must be greater than or equal to 0.
              if num < 0 and array[mid - 1] >= 0:
                     return mid

              if num >= 0:
                     A__		   =		mid + 1
              else:
                     A__		   =		mid - 1
    # No negative numbers so return the last index of the array + 1 which is the length.
       return len(UpperCamelCase__    )


def       UpperCamelCase__(			UpperCamelCase__     :			list[list[int]]    )->int:
       A__		   =		0
       A__		   =		len(grid[0]    )

       for i in range(len(UpperCamelCase__    )    ):
              A__		   =		find_negative_index(grid[i][:bound]    )
              total += bound
       return (len(UpperCamelCase__    ) * len(grid[0]    )) - total


def       UpperCamelCase__(			UpperCamelCase__     :			list[list[int]]    )->int:
       return len([number for row in grid for number in row if number < 0]    )


def       UpperCamelCase__(			UpperCamelCase__     :			list[list[int]]    )->int:
       A__		   =		0
       for row in grid:
              for i, number in enumerate(UpperCamelCase__    ):
                     if number < 0:
                            total += len(UpperCamelCase__    ) - i
                            break
       return total


def       UpperCamelCase__(			)->None:
       from timeit import timeit

       print('''Running benchmarks'''    )
       A__		   =		(
           '''from __main__ import count_negatives_binary_search, '''
           '''count_negatives_brute_force, count_negatives_brute_force_with_break, grid'''
       )
       for func in (
           "count_negatives_binary_search",  # took 0.7727 seconds
           "count_negatives_brute_force_with_break",  # took 4.6505 seconds
           "count_negatives_brute_force",  # took 12.8160 seconds
       ):
              A__		   =		timeit(f"{func}(grid=grid)"					,	setup=UpperCamelCase__					,	number=5_00    )
              print(f"{func}() took {time:0.4f} seconds"    )


if __name__ == "__main__":
       import doctest

       doctest.testmod()
       benchmark()












def       UpperCamelCase__(			UpperCamelCase__     :			str = "The quick brown fox jumps over the lazy dog"					,	)->bool:
       A__		   =		set()

       # Replace all the whitespace in our sentence
       A__		   =		input_str.replace(''' '''					,	''''''    )
       for alpha in input_str:
              if "a" <= alpha.lower() <= "z":
                     frequency.add(alpha.lower()    )
       return len(UpperCamelCase__    ) == 26


def       UpperCamelCase__(			UpperCamelCase__     :			str = "The quick brown fox jumps over the lazy dog"					,	)->bool:
       A__		   =		[False] * 26
       for char in input_str:
              if char.islower():
                     A__		   =		True
              elif char.isupper():
                     A__		   =		True
       return all(UpperCamelCase__    )


def       UpperCamelCase__(			UpperCamelCase__     :			str = "The quick brown fox jumps over the lazy dog"					,	)->bool:
       return len({char for char in input_str.lower() if char.isalpha()}    ) == 26


def       UpperCamelCase__(			)->None:
       from timeit import timeit

       A__		   =		'''from __main__ import is_pangram, is_pangram_faster, is_pangram_fastest'''
       print(timeit('''is_pangram()'''					,	setup=UpperCamelCase__    )    )
       print(timeit('''is_pangram_faster()'''					,	setup=UpperCamelCase__    )    )
       print(timeit('''is_pangram_fastest()'''					,	setup=UpperCamelCase__    )    )
       # 5.348480500048026, 2.6477354579837993, 1.8470395830227062
       # 5.036091582966037, 2.644472333951853,  1.8869528750656173


if __name__ == "__main__":
       import doctest

       doctest.testmod()
       benchmark()





