def get_time_tied_leading_trailing(event, previous_score, last_goal_time):
    """
    Calculate time of previous score state according to current event time
    and time of last goal scored.
    """
    if previous_score['home'] == previous_score['road']:
        return 'tied', event['time'] - last_goal_time
    elif previous_score['home'] > previous_score['road']:
        return 'home_leading', event['time'] - last_goal_time
    elif previous_score['home'] < previous_score['road']:
        return 'road_leading', event['time'] - last_goal_time