def filter_articles(
        articles: list[dict], search_terms: str) -> list[dict]:
    """Returns all articles containing a given search term in them.

    Takes a list of articles and filters them by their title, only
    returning articles that contain at least one of the search terms in
    their title.

    Args:
        articles: A list of news articles.
        search_terms: A space separated string of search terms.

    Returns:
        A list containing only the articles with titles that contained
        a search term.
    """
    relevant_articles = []
    for article in articles:
        title = article["title"].lower()
        if any(term.lower() in title for term in search_terms.split()):
            relevant_articles.append(article)
    return relevant_articles