def isInverse(a, b) -> bool:
    """Check if two provided directions are the opposites of each other.
  """
    if (a == "L" and b == "R") or (a == "R" and b == "L"):
        return True
    if (a == "U" and b == "D") or (a == "D" and b == "U"):
        return True

    return False