




def lowerCamelCase__       (      ):

     '''simple docstring'''


     return [list(range(1000 - i			,						-1000 - i			,						-1				)				) for i in range(1000				)]


__a          =			generate_large_matrix()
__a          =			(
    [[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 lowerCamelCase__       (      _lowercase				):

     '''simple docstring'''


     assert all(row == sorted(a__			,						reverse=a__				) for row in grid				)
     assert all(list(a__				) == sorted(a__			,						reverse=a__				) for col in zip(*a__				)				)







def lowerCamelCase__       (      _lowercase				):

     '''simple docstring'''


     UpperCAmelCase_      :							Optional[int]       =      0
     UpperCAmelCase_      :							Dict       =      len(a__				) - 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:
          UpperCAmelCase_      :							List[Any]       =      (left + right) // 2
          UpperCAmelCase_      :							Dict       =      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:
               UpperCAmelCase_      :							int       =      mid + 1
          else:
               UpperCAmelCase_      :							Dict       =      mid - 1
          # No negative numbers so return the last index of the array + 1 which is the length.
     return len(a__				)







def lowerCamelCase__       (      _lowercase				):

     '''simple docstring'''


     UpperCAmelCase_      :							List[Any]       =      0
     UpperCAmelCase_      :							List[Any]       =      len(grid[0]				)

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







def lowerCamelCase__       (      _lowercase				):

     '''simple docstring'''


     return len([number for row in grid for number in row if number < 0]				)







def lowerCamelCase__       (      _lowercase				):

     '''simple docstring'''


     UpperCAmelCase_      :							Union[str, Any]       =      0
     for row in grid:
          for i, number in enumerate(a__				):
               if number < 0:
                    total += len(a__				) - i
                    break
     return total







def lowerCamelCase__       (      ):

     '''simple docstring'''


     from timeit import timeit

     print('''Running benchmarks'''				)
     UpperCAmelCase_      :							List[Any]       =      (
         '''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
     ):
          UpperCAmelCase_      :							List[Any]       =      timeit(f'''{func}(grid=grid)'''			,						setup=a__			,						number=500				)
          print(f'''{func}() took {time:0.4f} seconds'''				)


if __name__ == "__main__":
     import doctest

     doctest.testmod()
     benchmark()





from collections import defaultdict







def lowerCamelCase__       (      _lowercase			,						_lowercase				):

     '''simple docstring'''


     UpperCAmelCase_      :							Optional[int]       =      first_str.lower().strip()
     UpperCAmelCase_      :							Any       =      second_str.lower().strip()

     # Remove whitespace
     UpperCAmelCase_      :							Any       =      first_str.replace(''' '''			,						''''''				)
     UpperCAmelCase_      :							int       =      second_str.replace(''' '''			,						''''''				)

     # Strings of different lengths are not anagrams
     if len(_lowercase				) != len(_lowercase				):
          return False

     # Default values for count should be 0
     UpperCAmelCase_      :							defaultdict[str, int]       =      defaultdict(_lowercase				)

     # For each character in input strings,
     # increment count in the corresponding
     for i in range(len(_lowercase				)				):
          count[first_str[i]] += 1
          count[second_str[i]] -= 1

     return all(_count == 0 for _count in count.values()				)


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

     testmod()
     __a          =			input('Enter the first string ').strip()
     __a          =			input('Enter the second string ').strip()

     __a          =			check_anagrams(input_a, input_b)
     print(F"""{input_a} and {input_b} are {"" if status else "not "}anagrams.""")