def rule_applicable(rule: dict, monthly: dict) -> bool:
    """Helper function to return whether a rule is applicable for the given month's spendings.

    Args:
        - monthly: dictionary containing total monthly spendings at merchants in a month
        - rule: the rule to check compatability with

    Returns:
        - app: True if rule is applicable, False otherwise
    """
    app = True
    for shop in rule.keys():
        if shop not in monthly.keys():
            app = False
    return app