'''simple docstring'''





def 			A__      (	snake_case_ :		str      ):
 SCREAMING_SNAKE_CASE__:   int=      len(_snake_case      )
 SCREAMING_SNAKE_CASE__:   Optional[Any]=      len(matrix[0]      )
 SCREAMING_SNAKE_CASE__:   Any=      min(_snake_case       ,				_snake_case      )

 for row in range(_snake_case      ):
  # Check if diagonal element is not zero
  if matrix[row][row] != 0:
   # Eliminate all the elements below the diagonal
   for col in range(row + 1       ,				_snake_case      ):
    SCREAMING_SNAKE_CASE__:   str=      matrix[col][row] / matrix[row][row]
    for i in range(_snake_case       ,				_snake_case      ):
     matrix[col][i] -= multiplier * matrix[row][i]
  else:
   # Find a non-zero diagonal element to swap rows
   SCREAMING_SNAKE_CASE__:   int=      True
   for i in range(row + 1       ,				_snake_case      ):
    if matrix[i][row] != 0:
     SCREAMING_SNAKE_CASE__,	SCREAMING_SNAKE_CASE__:   List[Any]=      matrix[i], matrix[row]
     SCREAMING_SNAKE_CASE__:   Union[str, Any]=      False
     break
   if reduce:
    rank -= 1
    for i in range(_snake_case      ):
     SCREAMING_SNAKE_CASE__:   Dict=      matrix[i][rank]

            # Reduce the row pointer by one to stay on the same row
   row -= 1

 return rank


if __name__ == "__main__":
      import doctest

      doctest.testmod()


import re







def 			A__      (	snake_case_ :		str      ):

 if len(re.findall('''[ATCG]'''       ,				snake_case_      )      ) != len(snake_case_      ):
  raise ValueError('''Invalid Strand'''      )

 return dna.translate(dna.maketrans('''ATCG'''       ,				'''TAGC'''      )      )


if __name__ == "__main__":
      import doctest

      doctest.testmod()

