# Problem Description
The task is to create a function `solution` that determines if a given string is valid based on certain criteria. The criteria for validity are not explicitly stated in the problem description but can be inferred from the accompanying image. The function should take a single string as input and return a boolean value indicating whether the string meets the criteria.

# Visual Facts
1. The image shows several strings with corresponding boolean values (TRUE or FALSE).
2. The strings are:
   - "masdgfsgdgsfgdsam" -> TRUE
   - "MaMAM" -> TRUE
   - "MAMA" -> FALSE
   - "hOppoh" -> TRUE
   - "OPENAI" -> FALSE
   - "super" -> FALSE
   - "Super" -> FALSE
3. There is a blue dashed line in the middle of each `TRUE` string, suggesting a point of symmetry.

# Visual Patterns
1. **Symmetry**: The strings that are marked as TRUE appear to be symmetrical around the blue dashed line. This suggests that the strings are palindromes.
2. **Case Insensitivity**: The strings marked as TRUE are palindromes when case is ignored. For example, "MaMAM" and "hOppoh" are palindromes if we ignore case.
3. **Non-Palindromes**: The strings marked as FALSE are not palindromes, even when case is ignored. For example, "MAMA" and "OPENAI" do not read the same forwards and backwards.
4. **Length**: There is no specific length constraint observed from the image. Both even and odd length strings are considered.
5. **Case Sensitivity**: The strings "super" and "Super" are marked as FALSE, indicating that case sensitivity alone does not determine validity.

# Solution
def solution(str1: str) -> bool:
    """
    Determines if the given string is valid according to the image criteria.

    Parameters:
        str1 (str): The input string to validate.

    Returns:
        bool: True if the string is valid, False otherwise.
    """
    # return all(char.islower() for char in str1 if char.isalpha())
    # change string into all lowercase
    str2 = str1.lower()
    if str2 == str2[::-1]:
        return True
    return False



# Test Script
def test():
    test_cases = [
        ("aba", True),
        ("openai", False),
        ("masdgFsgdgsfgdsam", True),
        ("masdgfsgdgsfgdSam", True),
        ("masdgfsgfgdsam", False),
        ("madam", True),
        ("Hello", False),
        ("HellolleH", True),
        ("Hellolleh", True),
        ("MADAM", True),
    ]

    for str1, expected_output in test_cases:
        try:
            output = solution(str1)
        except Exception as e:
            error_message = (
                f"An exception occurred while running the test case:\n"
                f"`str1`: {str1}\n\n"
                f"Exception: '{str(e)}'"
            )
            assert False, error_message

        if output != expected_output:
            error_message = (
                f"The following Test Case failed:\n"
                f"`str1`: {str1}\n\n"
                f"Actual Output: {output}\n"
                f"Expected Output: {expected_output}"
            )
            assert False, error_message

test()