Given an array of workout metrics, write an optimized algorithm to find the longest contiguous sub-array where the user's heart rate remained within a target zone for Tempo.
Treat the workout metrics array as heart-rate readings in chronological order. Implement longest_zone_streak(metrics, lower, upper), returning the maximum number of consecutive readings whose values are between lower and upper, inclusive. Return 0 when no reading is in the zone.
def longest_zone_streak(metrics, lower, upper):