Given an array of integers, design an algorithm to find the longest contiguous subarray with a sum equal to a target value.