import requests


def status_crawler(LEETCODE_SESSION: str, question_name: str) -> bool:
    """Check if question solved

    Args:
        LEETCODE_SESSION (str): User's LeetCode session.
        question_name (str): LeetCode question name.

    Returns:
        bool: Solved or not.
    """
    cookies = {"LEETCODE_SESSION": LEETCODE_SESSION}
    response = requests.get(
        "https://leetcode.com/api/problems/all/", cookies=cookies
    ).json()
    for question in response["stat_status_pairs"]:
        question_title = question["stat"]["question__title"]
        if question_title == question_name:
            if question["status"] == "ac":
                return True
    return False