def time_str_to_int(s: str) -> int:
    """
    Convert 24-hour or 12-hour time string to int hour of the day

    Parameters
    ----------
    s : str
        24-hour or 12-hour time string

    Returns
    -------
    int
        Hour of the day between [0,24)
    """
    if ":" in s:
        # this is a 24-hour string
        return int(s.strip().split(":")[0])
    elif "am" in s.lower():
        # This is a 12-hour string
        return int(s.lower().split("am")[0].strip()) % 12
    elif "pm" in s.lower():
        # This is a 12-hour string
        return (int(s.lower().split("pm")[0].strip()) % 12) + 12
    else:
        # Make no assumptions about what time they are using
        # throw an error to be safe
        raise ValueError(
            f"Given string '{s}' is not of the form ##:00 or ##AM or ##PM."
        )